DNS Records Explained: A, AAAA, MX, TXT, CNAME, NS
Quick Answer
DNS records tell the internet how to handle your domain. A records point to IPv4 addresses, AAAA to IPv6, MX routes email, TXT stores text metadata, CNAME aliases one domain to another, and NS delegates to nameservers. Use our free DNS Lookup tool to query any record type.
Introduction
DNS (Domain Name System) records are entries in a DNS database that map domain names to IP addresses and other routing information. Each record type serves a specific purpose, from pointing a domain to a server to configuring email routing. Understanding DNS records is essential for web developers, system administrators, and anyone managing a domain.
Step by Step
-
A Record (IPv4 Address)
The A record maps a domain name to an IPv4 address (e.g., 93.184.216.34). This is the most common DNS record type, used to point your domain to your web server.
-
AAAA Record (IPv6 Address)
The AAAA record maps a domain name to an IPv6 address (e.g., 2606:2800:220:1:248:1893:25c8:194). As IPv6 adoption grows, AAAA records are increasingly important.
-
MX Record (Mail Exchange)
MX records specify the mail servers that handle email for your domain, with a priority value (lower = higher priority). Example: example.com MX 10 mail.example.com.
-
TXT Record (Text)
TXT records store arbitrary text data, commonly used for SPF, DKIM, DMARC email authentication, domain verification, and other metadata.
-
CNAME Record (Canonical Name)
CNAME records alias one domain name to another. Commonly used to point www.example.com to example.com, or to point a domain to a hosted service like GitHub Pages.
-
NS Record (Nameserver)
NS records specify the authoritative nameservers for a domain. These are the servers that hold the actual DNS records for your domain.
Examples
A record for example.com
Input: dig example.com A
Output: 93.184.216.34
MX record for gmail.com
Input: dig gmail.com MX
Output: 5 gmail-smtp-in.l.google.com. (priority 5)
TXT record for SPF
Input: dig example.com TXT
Output: "v=spf1 include:_spf.google.com ~all"
CNAME for www
Input: dig www.example.com CNAME
Output: example.com.
Common Problems
- DNS propagation can take 24-48 hours β changes are not immediate due to caching at multiple levels.
- CNAME records cannot coexist with other record types for the same name β use A records instead if you need other records.
- MX records require a priority value β omitting it can cause email delivery issues.
- TXT records have a maximum length of 255 characters per string β longer values must be split into multiple strings.
Tips
- Use our DNS Lookup tool to verify your DNS records are correctly configured.
- Set a low TTL (300 seconds) when making changes, then increase it after propagation.
- Always include both A and AAAA records if your server supports IPv6.
- Use SPF, DKIM, and DMARC TXT records to improve email deliverability and prevent spoofing.