DNS Record Types Explained: A, AAAA, CNAME, MX, TXT, NS, SOA
A complete guide to DNS record types including A, AAAA, CNAME, MX, TXT, NS, and SOA records. Learn when to use each type with real-world examples.
Last updated: 2026-02-17
Every domain on the internet relies on DNS records to function. These records are instructions stored on authoritative nameservers that tell the rest of the internet how to find your website, where to deliver your email, and how to verify your domain's identity.
There are dozens of DNS record types defined in various RFCs, but most domains use fewer than ten. This guide covers the seven record types you will encounter most often, with practical examples and guidance on when to use each one.
A Record
The A record is the most fundamental DNS record type. It maps a domain name to an IPv4 address.
When someone types example.com into a browser, the DNS resolver ultimately needs an IP address to connect to. The A record provides that mapping.
example.com. 300 IN A 93.184.216.34
When to use A records
- Pointing your root domain (
example.com) to a web server - Pointing subdomains (
api.example.com) to specific servers - Any situation where you need a domain to resolve to a specific IPv4 address
Key considerations
A records can only point to IPv4 addresses. You can have multiple A records for the same domain, which is a basic form of load balancing called DNS round-robin. The resolver will return all records, and the client chooses one.
Multiple A records for redundancy
Adding two or more A records for the same hostname provides basic failover. If one server goes down, clients may try the next IP. However, this is not a substitute for proper load balancing since DNS has no awareness of server health.
AAAA Record
The AAAA record is the IPv6 equivalent of the A record. It maps a domain name to an IPv6 address.
example.com. 300 IN AAAA 2606:2800:220:1:248:1893:25c8:1946
The name "AAAA" (quad-A) reflects that IPv6 addresses are four times the size of IPv4 addresses (128 bits vs 32 bits). As IPv6 adoption grows, AAAA records become increasingly important.
When to use AAAA records
- Whenever your server supports IPv6 (which it should)
- Alongside A records for dual-stack connectivity
- Required for IPv6-only networks, which are becoming more common on mobile carriers
Most modern configurations include both A and AAAA records. Clients that support IPv6 will prefer the AAAA record, while older clients fall back to the A record.
CNAME Record
A CNAME (Canonical Name) record creates an alias from one domain name to another. Instead of pointing to an IP address, it points to another hostname.
www.example.com. 300 IN CNAME example.com.
blog.example.com. 300 IN CNAME hosting-provider.com.
When a resolver encounters a CNAME, it follows the chain and resolves the target hostname to get the final IP address.
When to use CNAME records
- Pointing
wwwto your root domain - Pointing subdomains to third-party services (CDNs, SaaS platforms, hosting providers)
- Domain verification for services like Google Workspace or AWS Certificate Manager
Critical restrictions
CNAME records have a rule that trips up many administrators: a CNAME cannot coexist with any other record type at the same name. This means you cannot put a CNAME on your root domain (example.com) if you also have MX records there, which you almost certainly do.
CNAME at the root domain
You cannot use a CNAME record on your root domain (apex/naked domain) because the root domain must also have NS and SOA records, which conflict with CNAME. Some DNS providers offer proprietary workarounds like ALIAS or ANAME records to solve this.
MX Record
MX (Mail Exchange) records specify which mail servers handle email for a domain. Without correct MX records, email sent to your domain will not be delivered.
example.com. 300 IN MX 10 mail1.example.com.
example.com. 300 IN MX 20 mail2.example.com.
The number before the mail server hostname is the priority value. Lower numbers indicate higher priority. In the example above, mail is delivered to mail1.example.com first. If that server is unavailable, the sending server tries mail2.example.com.
When to use MX records
- Routing email to your mail server or email hosting provider
- Setting up Google Workspace, Microsoft 365, or any email service
- Configuring backup mail servers with different priority values
| Priority | Mail Server | Purpose |
|---|---|---|
| 10 | mail1.example.com | Primary mail server |
| 20 | mail2.example.com | Secondary (backup) mail server |
| 30 | mail3.example.com | Tertiary mail server |
Key considerations
MX records must point to a hostname, not an IP address. That hostname must have its own A or AAAA record. An MX record should never point to a CNAME.
Monitor your MX records continuously
Email outages caused by MX record changes are preventable. DNS Monitor alerts you immediately when any mail-related DNS record changes.
TXT Record
TXT records hold arbitrary text data associated with a domain. Originally designed for human-readable notes, they now serve critical roles in email authentication and domain verification.
example.com. 300 IN TXT "v=spf1 include:_spf.google.com ~all"
example.com. 300 IN TXT "google-site-verification=abc123..."
Common uses for TXT records
SPF (Sender Policy Framework)
Specifies which mail servers are authorized to send email on behalf of your domain. Prevents email spoofing and improves deliverability.
DKIM (DomainKeys Identified Mail)
Published as a TXT record under a selector subdomain (e.g., selector1._domainkey.example.com). Contains the public key used to verify email signatures.
DMARC (Domain-based Message Authentication)
Published at _dmarc.example.com, this TXT record tells receiving mail servers what to do when SPF or DKIM checks fail.
Domain verification
Services like Google, Microsoft, Facebook, and many SaaS platforms ask you to add a specific TXT record to prove you own the domain.
TXT records have a 255-character limit per string, but you can concatenate multiple strings within a single record for longer values.
NS Record
NS (Name Server) records delegate a domain or subdomain to a set of authoritative nameservers. These records are fundamental to how DNS delegation works.
example.com. 86400 IN NS ns1.dnsprovider.com.
example.com. 86400 IN NS ns2.dnsprovider.com.
When NS records matter
NS records at the root of your domain are set at the registrar level and determine which DNS provider controls your zone. Changing these records is how you migrate DNS providers.
You can also use NS records to delegate subdomains to different nameservers. For example, a company might delegate staging.example.com to a separate DNS provider used by their development team.
Key considerations
You should always have at least two NS records for redundancy. Most providers give you two to four nameservers. If all nameservers become unreachable, your entire domain becomes unresolvable.
SOA Record
The SOA (Start of Authority) record contains administrative information about the DNS zone. Every zone must have exactly one SOA record.
example.com. 86400 IN SOA ns1.dnsprovider.com. admin.example.com. (
2024010101 ; serial number
3600 ; refresh
900 ; retry
1209600 ; expire
300 ; minimum TTL
)
SOA record fields explained
- Primary nameserver: The main authoritative nameserver for the zone
- Admin email: The responsible person's email (the
@is replaced with a.) - Serial number: Incremented with each zone change; used by secondary servers to detect updates
- Refresh: How often secondary servers check for updates
- Retry: How long to wait before retrying a failed refresh
- Expire: How long secondary servers serve data without a successful refresh
- Minimum TTL: The default TTL for negative caching (NXDOMAIN responses)
Most DNS administrators rarely edit SOA records directly since managed DNS providers handle them automatically. But understanding the SOA is useful when troubleshooting zone transfer issues or negative caching behavior.
How Records Work Together
DNS record types do not exist in isolation. A typical domain uses several types simultaneously.
NS records delegate the zone
The registrar's NS records point to your DNS provider, establishing who is authoritative for your domain.
A and AAAA records serve your website
These point your domain to the web server's IP addresses. CNAME records may alias subdomains to these or to CDN hostnames.
MX records route email
These point to your email provider's mail servers, with priority values determining the delivery order.
TXT records secure email and verify ownership
SPF, DKIM, and DMARC records authenticate your email. Verification TXT records prove domain ownership to third-party services.
SOA record governs the zone
The SOA provides zone-level metadata including serial numbers for change detection and TTL defaults for negative caching.
Choosing the Right Record Type
| Goal | Record Type | Example |
|---|---|---|
| Point domain to IPv4 server | A | example.com → 93.184.216.34 |
| Point domain to IPv6 server | AAAA | example.com → 2606:2800:... |
| Alias a subdomain to another hostname | CNAME | www → example.com |
| Route email to mail servers | MX | example.com → mail.provider.com |
| Authenticate email (SPF/DKIM/DMARC) | TXT | v=spf1 include:... ~all |
| Delegate DNS to nameservers | NS | example.com → ns1.provider.com |
| Define zone authority | SOA | Automatically managed |
Understanding DNS record types is the foundation for managing any domain reliably. Each record type serves a specific purpose, and misconfiguring even one can break email delivery, take a website offline, or leave a domain vulnerable to impersonation.
Keep every DNS record under watch
DNS Monitor tracks all record types across your domains and alerts you instantly when anything changes. Never miss a broken MX record or modified A record again.