The Domain Name System (DNS) is the foundational routing layer of the internet. While every developer encounters DNS when launching a site or connecting a domain, the nuances between different record types—such as A vs AAAA, CNAME vs ALIAS, or CAA issuance restrictions—often cause downtime and misconfigurations.
This cheat sheet provides clear technical explanations, syntax examples, and best practices for every primary DNS record type.
1. A Record (Address Record)
The most fundamental DNS record. Maps a human-readable hostname to a 32-bit IPv4 address.
; Syntax: [Host] [TTL] [Class] [Type] [IPv4 Address]
example.com. 3600 IN A 192.0.2.1
api.example.com. 300 IN A 198.51.100.24Use Cases: Pointing root domains and subdomains directly to dedicated servers, load balancers, or VPS instances.
2. AAAA Record (IPv6 Address Record)
The 128-bit IPv6 equivalent of an A record. Essential for modern dual-stack web infrastructure and mobile carrier routing.
example.com. 3600 IN AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334Tip: You can test whether your domain resolves over IPv6 using our IPv6 Readiness Checker.
3. CNAME Record (Canonical Name)
Creates an alias pointing one hostname to another hostname. Resolvers follow the alias until they find an A or AAAA record.
www.example.com. 3600 IN CNAME example.com.
docs.example.com. 300 IN CNAME cname.gitbook.io.The Apex Limitation: Per RFC 1034, a CNAME cannot coexist with other records (like SOA and NS) at the zone apex (@). To point your root domain to services like Vercel, Netlify, or Shopify, use CNAME Flattening, ALIAS, or ANAME provided by your DNS host (Cloudflare, Route53, DNSimple).
4. MX Record (Mail Exchanger)
Directs inbound email to designated mail servers. Includes an explicit numeric priority (preference) value.
example.com. 3600 IN MX 1 aspmx.l.google.com.
example.com. 3600 IN MX 5 alt1.aspmx.l.google.com.
example.com. 3600 IN MX 10 alt2.aspmx.l.google.com.Rules: Lower priority numbers take precedence. The target hostname must resolve to an A/AAAA record, not another CNAME. Check your mail configuration with our MX Lookup Tool.
5. TXT Record (Text Record)
Stores human and machine-readable arbitrary text metadata. TXT records power modern domain ownership verification and email security protocols:
- SPF:
v=spf1 include:_spf.google.com -all - DMARC:
v=DMARC1; p=reject; rua=mailto:dmarc@example.com - DKIM:
v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQU... - Domain Verification:
google-site-verification=abcdef123456
Query all published TXT records with our TXT Lookup.
6. CAA Record (Certification Authority Authorization)
Restricts which Certificate Authorities (CAs) are authorized to issue SSL/TLS certificates for your domain.
example.com. 3600 IN CAA 0 issue "letsencrypt.org"
example.com. 3600 IN CAA 0 issuewild "digicert.com"
example.com. 3600 IN CAA 0 iodef "mailto:security@example.com"Inspect your CAA tags using our CAA Lookup Tool.
7. PTR Record (Pointer Record)
Used in reverse DNS (rDNS) lookups to resolve an IP address back to its associated hostname. Stored under special reverse domains like in-addr.arpa (IPv4) or ip6.arpa (IPv6).
10.113.0.203.in-addr.arpa. 3600 IN PTR mail.example.com.Verify your IP reverse PTR configuration using our Reverse DNS Tool.
8. NS Record (Name Server)
Delegates a DNS zone to authoritative nameservers responsible for resolving records for that domain.
example.com. 86400 IN NS ns1.cloudflare.com.
example.com. 86400 IN NS ns2.cloudflare.com.Summary Reference Table
| Type | Purpose | Target Example |
|---|---|---|
| A | Hostname to IPv4 | 192.0.2.1 |
| AAAA | Hostname to IPv6 | 2001:db8::1 |
| CNAME | Hostname to Hostname Alias | app.example.com |
| MX | Mail Routing & Priority | 10 mail.example.com |
| TXT | Text, SPF, DMARC, Verification | "v=spf1 -all" |
| CAA | SSL Certificate Issuance Lock | 0 issue "letsencrypt.org" |
| PTR | Reverse DNS (IP to Hostname) | host.example.com |
To inspect every published DNS record for any domain in parallel, use our comprehensive All DNS Records Suite or DNS Lookup Tool.
