DNS Record Types Explained
Learn about A, AAAA, MX, NS, TXT, CNAME, SOA, CAA, and other DNS record types. Understand when and how to use each one.
Overview
DNS records are instructions stored on DNS servers that tell the world how to find your domain and its services. Each record type serves a specific purpose, from pointing to your website's IP address to defining which servers handle your email.
Understanding these record types is essential for managing your domain's online presence, troubleshooting issues, and setting up services correctly.
A Record (Address)
Maps a domain name to an IPv4 address
example.com. 300 IN A 93.184.216.34The A record is the most fundamental DNS record type. It directly maps a domain or subdomain to a 32-bit IPv4 address. When someone types your domain into their browser, the A record tells them where to find your web server.
Common Uses:
- Pointing your domain to your web server
- Setting up subdomains like
blog.example.com - Load balancing by having multiple A records for the same domain
Best Practices:
- Use a reasonable TTL (300-3600 seconds for most cases)
- Consider using multiple A records for redundancy
- Always have a corresponding AAAA record for IPv6
AAAA Record (IPv6 Address)
Maps a domain name to an IPv6 address
example.com. 300 IN AAAA 2606:2800:220:1:248:1893:25c8:1946The AAAA record (pronounced "quad-A") is the IPv6 equivalent of the A record. As IPv4 addresses become scarce, IPv6 adoption is growing, making AAAA records increasingly important.
Why IPv6 Matters:
- IPv4 has approximately 4.3 billion addresses; IPv6 has 340 undecillion
- Many mobile networks are IPv6-only
- Better performance in some networks
- Future-proofing your infrastructure
CNAME Record (Canonical Name)
Creates an alias pointing to another domain name
www.example.com. 300 IN CNAME example.com.A CNAME record creates an alias from one domain name to another. Instead of pointing to an IP address, it points to another domain name, which then resolves to an IP address.
Common Uses:
- Pointing
wwwto your root domain - Connecting to CDN or cloud services
- Creating memorable subdomains for third-party services
Important Rules:
- Cannot be used at the zone apex (root domain)
- Cannot coexist with other records for the same name
- Creates an extra DNS lookup, slightly increasing latency
MX Record (Mail Exchange)
Specifies mail servers that handle email for the domain
example.com. 300 IN MX 10 mail.example.com.MX records define which mail servers accept email for your domain. The priority number determines which server to try first (lower numbers = higher priority).
Priority System:
- Lower priority values are tried first
- Multiple MX records provide redundancy
- If the primary server is down, mail goes to the backup
Example Setup:
example.com. MX 10 mail1.example.com. example.com. MX 20 mail2.example.com. example.com. MX 30 backup.example.com.
Validate your email configuration with our Email Authentication Tool.
TXT Record (Text)
Stores text information, often for verification and security
example.com. 300 IN TXT "v=spf1 include:_spf.google.com ~all"TXT records store arbitrary text data. While originally designed for human-readable notes, they're now primarily used for machine-readable data like email authentication and domain verification.
Common Uses:
- SPF: Specifies which servers can send email for your domain
- DKIM: Contains public keys for email signing
- DMARC: Defines email authentication policies
- Domain Verification: Proving ownership to services like Google, Microsoft, and SSL providers
Size Limits:
TXT records are limited to 255 characters per string, but you can have multiple strings in a single record that are concatenated together.
NS Record (Nameserver)
Specifies authoritative nameservers for the domain
example.com. 86400 IN NS ns1.example.com.NS records specify which DNS servers are authoritative for your domain. They're essential for the DNS delegation system, allowing the domain hierarchy to work.
Best Practices:
- Always have at least 2 NS records for redundancy
- Use nameservers in different geographic locations
- Use a long TTL (86400 seconds / 24 hours is common)
- Ensure all listed nameservers are functioning
SOA Record (Start of Authority)
Contains administrative information about the zone
example.com. 86400 IN SOA ns1.example.com. admin.example.com. 2024011501 7200 3600 1209600 86400The SOA record contains essential information about the DNS zone, including the primary nameserver, administrator email, and timing parameters for zone transfers and caching.
SOA Fields:
- Primary NS: Primary nameserver for the zone
- Admin Email: Administrator email (@ replaced with .)
- Serial: Version number (often YYYYMMDDNN format)
- Refresh: How often secondaries check for updates
- Retry: Retry interval after failed refresh
- Expire: When secondary data is no longer authoritative
- Minimum TTL: Default negative caching TTL
CAA Record (Certificate Authority Authorization)
Specifies which CAs are allowed to issue certificates for the domain
example.com. 86400 IN CAA 0 issue "letsencrypt.org"CAA records specify which Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your domain. This helps prevent unauthorized certificate issuance.
CAA Tags:
issue: Allows the CA to issue standard certificatesissuewild: Allows the CA to issue wildcard certificatesiodef: Email/URL for violation reports
Example Setup:
example.com. CAA 0 issue "letsencrypt.org" example.com. CAA 0 issuewild "letsencrypt.org" example.com. CAA 0 iodef "mailto:security@example.com"
Check your CAA records with our Security Analysis Tool.
PTR Record (Pointer)
Maps an IP address to a domain name (reverse DNS)
34.216.184.93.in-addr.arpa. 300 IN PTR example.com.PTR records enable reverse DNS lookups, mapping IP addresses back to domain names. They're stored in the special in-addr.arpa zone for IPv4 and ip6.arpa for IPv6.
Why PTR Records Matter:
- Email servers check PTR records to verify sender legitimacy
- Security tools use reverse DNS for logging and identification
- Some services require matching forward and reverse DNS
PTR records are typically managed by your hosting provider or ISP since they control the IP address allocation.
SRV Record (Service)
Specifies location of servers for specific services
_sip._tcp.example.com. 300 IN SRV 10 5 5060 sipserver.example.com.SRV records define the hostname and port for specific services. They allow services to be discovered without hardcoding server addresses.
SRV Format:
_service._protocol.domain. TTL IN SRV priority weight port target
Common Uses:
- VoIP and SIP services
- XMPP/Jabber messaging
- Microsoft Active Directory
- Minecraft servers
Quick Reference Table
| Record | Purpose | Points To |
|---|---|---|
| A | Website address | IPv4 address |
| AAAA | Website address (IPv6) | IPv6 address |
| CNAME | Alias | Another domain |
| MX | Email routing | Mail server |
| TXT | Verification & security | Text data |
| NS | DNS delegation | Nameserver |
| SOA | Zone info | Zone parameters |
| CAA | Certificate control | Allowed CAs |
| PTR | Reverse lookup | Domain name |
| SRV | Service discovery | Service location |
Check Your DNS Records
Use our free tools to inspect and analyze your domain's DNS configuration: