// dns

DNS Record Types Cheatsheet

What each DNS record type does, an example, and the gotcha that bites people in production.

Updated

Record reference

TypePurposeExampleNotes
AIPv4 addressexample.com → 93.184.216.34Most common record. One name → one IPv4.
AAAAIPv6 addressexample.com → 2606:2800:220:1::IPv6 equivalent of A.
CNAMEAlias to another namewww → example.com.Cannot coexist with other records on the same name. Never on apex.
MXMail exchange10 mail.example.com.Lower priority = preferred. Points to a hostname, not an IP.
TXTText datav=spf1 include:_spf.google.com ~allUsed for SPF, DKIM, DMARC, domain verification.
NSAuthoritative nameserverns1.example.com.Delegates a zone. Set at registrar and at the parent zone.
SOAStart of authorityns1 hostmaster serial refresh retry expire minOne per zone. Holds zone metadata and refresh timers.
PTRReverse DNS34.216.184.93.in-addr.arpa → example.com.IP → name. Required for many mail servers.
SRVService location_sip._tcp 10 60 5060 sipserver.example.com.Priority + weight + port + target. Used by SIP, XMPP, AD.
CAACertificate authority authorization0 issue "letsencrypt.org"Restricts which CAs can issue certs for a domain.
TLSADANE TLS binding3 1 1 <hash>Pins a cert to a name. Requires DNSSEC.
DNSKEY / DS / RRSIGDNSSECPublic keys, delegation signers and signatures for DNSSEC validation.
ALIAS / ANAMEApex aliasexample.com → cdn.provider.net.Provider-specific. Solves the 'no CNAME at apex' rule.
NAPTRNaming authority pointer100 10 "u" "E2U+sip" "!^.*$!sip:user@ex!" .ENUM and complex service discovery.

FAQ

Why can't I put a CNAME on my apex domain (example.com)?
RFC 1034 forbids a CNAME alongside other record types, and the apex always has SOA and NS records. Use ALIAS/ANAME (provider-specific) or an A record pointing to a stable IP.
What's the difference between SPF, DKIM and DMARC?
SPF (TXT) authorizes which IPs can send mail. DKIM (TXT) signs messages cryptographically. DMARC (TXT) tells receivers what to do when SPF/DKIM fail and where to report.
How long does a DNS change take to propagate?
Up to the record's TTL. Lower the TTL (e.g. 300s) before a planned change so resolvers refresh quickly.
Do I need a PTR record?
Yes if you send email — most mail servers reject connections without matching forward and reverse DNS. PTR is set by whoever owns the IP block (usually your ISP or cloud provider).

Related