DNS Records Explained: A Guide to Every Record Type You'll Encounter
A, AAAA, CNAME, MX, TXT, NS, SOA — every DNS record type explained with examples of when and why you'd use each one.
DevPulse Team
DNS is the phone book of the internet, but the phone book has a lot of sections that most people never look at. If you've ever set up a custom domain, configured email, or debugged a website that "works on my machine" but not in production, you've dealt with DNS records. Here's what each type does.
A and AAAA Records: The Foundation
An A record maps a hostname to an IPv4 address. This is the most fundamental record type — when you type a domain into a browser, the DNS resolver eventually returns an A record telling it the IP address to connect to.
example.com. 300 IN A 93.184.216.34
An AAAA record does the same thing for IPv6 addresses. IPv6 uses 128-bit addresses (eight groups of four hexadecimal digits), and AAAA records are increasingly common as IPv6 adoption grows. Many sites have both A and AAAA records; the resolver uses whichever address family your network supports.
CNAME: Aliases
A CNAME (Canonical Name) record creates an alias — it points one hostname to another. When a resolver looks up the alias, it follows the chain to the canonical name and then resolves that.
www.example.com. 300 IN CNAME example.com.
CNAMEs are commonly used to point www subdomains to the apex domain, or to point a custom domain to a hosting provider's domain (e.g., shop.example.com CNAME your-store.myshopify.com).
Important restriction: a CNAME cannot coexist with other record types for the same hostname. You can't have a CNAME on the apex domain (example.com) alongside an MX record. This is why hosting providers offer "ALIAS" or "ANAME" records as workarounds.
MX Records: Email Routing
MX (Mail Exchanger) records tell email servers where to deliver mail for a domain. They point to mail server hostnames (not IP addresses — the IP is resolved separately via A records on the mail server's hostname) and include a priority number.
example.com. 300 IN MX 10 mail1.example.com.
example.com. 300 IN MX 20 mail2.example.com.
Lower priority numbers are preferred. If mail1 is unreachable, the sending server falls back to mail2. When you set up Google Workspace, Microsoft 365, or any hosted email provider, you update your MX records to point to their servers.
TXT Records: Verification and Policy
TXT records hold arbitrary text and are used for a wide variety of purposes:
- SPF — Sender Policy Framework specifies which servers are allowed to send email for your domain, reducing spoofing
- DKIM — stores the public key used to verify cryptographic signatures on outgoing email
- DMARC — email authentication policy: what to do when SPF/DKIM fail (quarantine, reject, or report)
- Domain verification — Google, Facebook, GitHub, and others ask you to add a specific TXT record to prove you own the domain
NS Records: Delegation
NS (Name Server) records specify which DNS servers are authoritative for a domain. When you register a domain and point it to your hosting provider or a service like Cloudflare, you're changing the NS records to delegate DNS resolution to their servers.
SOA Record: Zone Metadata
The SOA (Start of Authority) record contains administrative information about a DNS zone: the primary nameserver, the email address of the zone administrator (with the @ replaced by a dot), and several timing parameters (serial number, refresh interval, retry interval, expire, and TTL).
Checking Records in Practice
When something's wrong with DNS, you want to query multiple resolvers to see whether records have propagated. DNSLens queries across multiple DNS servers simultaneously so you can see exactly what each one returns — useful for diagnosing propagation delays after a DNS change.
Free developer tools, right in your browser.
No sign-up. No tracking. 30+ utilities for developers.
Explore DevPulse Tools →Related Articles
DNSLens: The Android DNS Lookup Tool Built for Propagation Checking
DNSLens is a free Android DNS lookup app that queries all record types across multiple resolvers and shows you propagation status — MATCH, MISMATCH, or ERROR — in real time.
NurseCalcNurseCalc: 40+ Clinical Calculators for Nurses and Allied Health
NurseCalc puts IV drip rates, clinical scores (GCS, Braden, NEWS, APGAR), dosage calculators, and unit converters in your pocket — offline, no account.
ToteRecallToteRecall: AI-Powered Storage Inventory for Your Home
ToteRecall uses AI to scan and identify what's in your storage boxes and totes. Photograph your bins, find anything instantly, and maintain a full audit trail.