DNS Record Types Cheat Sheet

Every DNS record type you will actually meet: what it does, what it looks like, and the five mistakes that break websites and email.

The record types

DNS is just a lookup table: name → typed value. The type decides what the value means.

TypeWhat it storesExample value
AIPv4 address of a host — the workhorse. Several A records on one name = round-robin load distribution.93.184.216.34
AAAAIPv6 address of a host. "Quad-A". If you serve IPv6, this sits next to the A record.2606:2800:220:1:248:1893:25c8:1946
CNAMECanonical name — an alias pointing one name at another name. Never at the zone apex (bare example.com), and never mixed with other records on the same name.example.com.
MXMail exchanger. Number = priority — lower is tried first. Must point at a hostname with an A/AAAA record, never at a CNAME.10 mail.example.com.
TXTFree text. Carries SPF, DKIM public keys, DMARC policy, and domain-verification tokens ("google-site-verification=…")."v=spf1 include:_spf.google.com ~all"
NSAuthoritative name servers for the zone. Set twice: at your registrar (delegation) and inside the zone itself.ns1.example.com.
SOAStart of Authority — one per zone. Holds the serial number (bump it on every edit: YYYYMMDDnn), refresh/retry/expire timers, and the admin contact.ns1.example.com. admin.example.com. 2026102201 …
SRVService location: priority weight port target. Used by SIP, XMPP, LDAP, Minecraft. Lives under _service._proto.name.10 60 5060 sip.example.com.
PTRReverse lookup — IP → name. Lives in the reverse zone (in-addr.arpa). Mail servers check it; missing rDNS is a classic spam flag.mail.example.com.
CAAWhich certificate authorities may issue for this domain. 0 issue "letsencrypt.org"; issuewild covers wildcards; iodef sets a violation-report address.0 issue "letsencrypt.org"
DS / DNSKEYDNSSEC chain of trust. DNSKEY lives in your zone, DS is published at the parent — together they prove records weren't tampered with in transit.(base64 key digests)
ALIAS / ANAMENot a real standard type — provider magic (Cloudflare calls it "CNAME flattening") that lets the apex behave like a CNAME. Handy; not portable.example.com.
DNAMEWhole-subtree alias — like a CNAME for everything under a name, not just the name itself. Rare outside large renames.example.net.
NAPTRRegex rewrite rules for a name. Mostly telephony (ENUM number mapping). You will probably never write one by hand.(regex + replacement)

Copy-paste zone snippets

Zone-file format (BIND style). @ = the apex (bare domain). A trailing dot means absolute — without it, the zone name gets appended.

; --- web: IPv4 + IPv6 + www alias ---
@        3600  IN  A      93.184.216.34
@        3600  IN  AAAA   2606:2800:220:1:248:1893:25c8:1946
www      3600  IN  CNAME  example.com.

; --- mail: MX + SPF + DKIM + DMARC (the email triple) ---
@        3600  IN  MX     10 mail.example.com.
@        3600  IN  MX     20 mail2.example.com.
@        3600  IN  TXT    "v=spf1 include:_spf.google.com ~all"
dkim._domainkey 3600 IN   TXT "v=DKIM1; k=rsa; p=MIIB..."
_dmarc   3600  IN  TXT    "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"

; --- service discovery (SIP example) ---
_sip._tcp 3600 IN  SRV    10 60 5060 sip.example.com.

; --- only allow Let's Encrypt to issue certs ---
@        3600  IN  CAA    0 issue "letsencrypt.org"

TTL & propagation

# TTL = seconds a resolver may cache the record. It is NOT a countdown
# to a global update — "propagation" is mostly old caches expiring.
#
# Picking a TTL:
#   300     (5 min)    before a migration — changes take effect fast
#   3600    (1 hour)   sane default for most records
#   86400   (1 day)    stable records you rarely touch (NS, MX)
#
# Moving servers? Lower the TTL to 300 a day BEFORE the move,
# then raise it back after everything is stable.

Lookups you can run

dig example.com A +short          # IPv4 address(es)
dig example.com AAAA +short       # IPv6 address(es)
dig example.com MX +short         # mail servers, priority order
dig example.com TXT +short        # SPF / DKIM / DMARC / verification
dig example.com NS +short         # authoritative name servers
dig example.com CAA +short        # allowed certificate authorities
dig -x 93.184.216.34 +short       # reverse lookup (PTR)
dig example.com +dnssec +multi    # ask for DNSSEC signatures too

nslookup -type=MX example.com     # Windows/macOS friendly
host -t TXT example.com           # short alternative to dig

Prefer a browser? Try these queries with HuanLog's own DNS Lookup tool — no terminal needed.

Gotchas that break things

# 1. CNAME at the apex is illegal. example.com CNAME other.com
#    breaks MX/NS/SOA (a name with a CNAME can't have other records).
#    Use your provider's ALIAS/ANAME or CNAME flattening instead.
# 2. MX must point at a real hostname (with A/AAAA), never at a
#    CNAME — RFC 2181. Mail will misbehave in subtle ways if you do.
# 3. SPF has a 10-DNS-lookup limit. Too many "include:" = permerror
#    and your mail starts failing SPF. Flatten or prune includes.
# 4. The trailing dot matters: "mail.example.com." is absolute,
#    "mail" becomes "mail.example.com." only by origin-appending.
#    Forgetting the dot in the wrong place doubles your domain.
# 5. Forgot to bump the SOA serial? Secondaries never pull your
#    edit. Convention: YYYYMMDD + two digits (2026102201).
# 6. A wildcard "*" CNAME catches every undefined name — including
#    typos you meant to notice, and it won't cover email.

Keep going