Understanding DNS Record Types: A, AAAA, CNAME, MX, TXT
A practical reference for the DNS record types that make up nearly every domain's configuration.
Core Concept
DNS records are the individual entries that define how a domain behaves — where it points, how mail is routed, and what ownership claims it makes.
Each record type serves a distinct purpose, and misconfiguring even one can break email delivery, site availability, or domain verification.
Address Records: A and AAAA
These records map a domain directly to an IP address, forming the most fundamental connection between a name and a server.
- A record — maps a hostname to an IPv4 address
- AAAA record — maps a hostname to an IPv6 address
- Both can hold multiple values for basic load distribution
Multiple A Records
When a domain has several A records, resolvers typically rotate between them, providing simple DNS-level load balancing.
Alias and Mail Records: CNAME and MX
CNAME and MX records handle two very different jobs: aliasing and mail routing.
- CNAME — points one hostname to another hostname, not an IP
- MX — specifies which mail servers accept email for the domain
- MX records include a priority value for failover ordering
Text Records and Verification
TXT records hold arbitrary text and have become the de facto mechanism for domain verification and email authentication.
Services from Google Workspace to SPF and DKIM all rely on TXT records to prove control over a domain without needing a dedicated record type.
Overloaded but Flexible
TXT records were never designed for authentication, but their flexibility made them the path of least resistance for dozens of verification protocols.
Other Common Record Types
Beyond the core set, several other record types appear regularly in production DNS zones.
- NS — delegates a domain or subdomain to specific nameservers
- SOA — holds authoritative zone metadata and refresh timing
- SRV — specifies host and port for a given service
Real-World Implementation
A well-configured production domain typically layers several record types together.
- A/AAAA records for the main site
- MX and supporting TXT records for email
- CNAME records for subdomains pointing to third-party services
Auditing the full record set together, rather than one record at a time, is the most reliable way to catch conflicts before they cause outages.
Common Mistakes to Avoid
A few common mistakes come up when configuring or troubleshooting DNS record types.
- Adding other records alongside a CNAME on the same hostname, which isn't permitted.
- Confusing an empty NOERROR response with an actual configuration error.
- Forgetting to set MX priority values correctly, causing mail routing issues.
- Overloading TXT records without considering the 255-character segment limits.
- Leaving stale records in place after a service migration is complete.
- Confusing CAA records with certificate transparency requirements.
- Overlooking PTR records as a distinct record type used for reverse DNS.
- Failing to understand how NAPTR records are used for certain telephony and SIP applications.
- Overlooking HTTPS and SVCB records, newer record types supporting service binding.
- Assuming record type behavior is identical across every DNS provider's interface.
- Failing to verify record propagation specifically for less common record types.
- Overlooking record type-specific size limits when planning DNS zone configuration.
Best Practices Checklist
These practices help keep DNS record configuration clean and reliable.
- Audit the full record set together rather than reviewing records one at a time.
- Remove stale or unused records promptly after decommissioning a service.
- Double-check MX priority ordering whenever adding a new mail provider.
- Verify CNAME records don't coexist with other record types on the same hostname.
- Document the purpose of each TXT record, since many services silently rely on them.
- Configure CAA records to restrict which certificate authorities can issue for your domain.
- Set up PTR records correctly for any mail-sending infrastructure.
- Document less common record types like NAPTR when they're actually in use.
- Familiarize yourself with newer record types like HTTPS and SVCB as adoption grows.
- Verify how your specific DNS provider's interface handles each record type.
- Check propagation specifically for less commonly used record types after changes.
- Check record type-specific size limits, particularly for TXT records with lengthy content.
Frequently Asked Questions
Frequently asked questions about common DNS record types.
What's the difference between an A record and a CNAME?
An A record points a hostname directly to an IP address, while a CNAME points a hostname to another hostname rather than an IP.
Why can't I add a CNAME alongside other records?
DNS specifications don't allow a CNAME to coexist with other record types on the same hostname, since a CNAME implies that hostname is purely an alias.
What does it mean when an MX lookup returns no error but no records?
This typically means the domain exists but simply doesn't have an MX record configured, which is different from an actual DNS failure.
Why do so many services use TXT records for verification?
TXT records accept arbitrary text, making them a flexible, low-friction way for services to verify domain ownership without needing a dedicated record type.
How many MX records can a domain have?
As many as needed, each with its own priority value determining the order mail servers are attempted for delivery.
What does a CAA record do?
It specifies which certificate authorities are authorized to issue TLS certificates for a domain, adding an extra layer of issuance control.
Is a PTR record the same as an A record?
No — a PTR record maps an IP address back to a hostname, the reverse of what an A record does.
What are NAPTR records used for?
They're used in specific applications like SIP telephony routing, which is less common than standard web and email record types.
What are HTTPS and SVCB records used for?
Newer record types designed to convey service binding information, like supported protocols, directly through DNS rather than requiring a separate lookup.
Does every DNS provider handle all record types identically?
Interface and validation behavior can differ meaningfully between providers, making direct verification worthwhile.
Do all record types have the same size limits?
No — different record types have their own constraints, with TXT records in particular subject to segment length limits.
See a Domain's Full Record Set
Run a DNS analysis to view every record type currently configured for a domain.
Launch Tool →