DNS Records Explained: Complete Guide to All DNS Record Types
Master every DNS record type from A to PTR. Understand how DNS resolution works with practical examples and a comprehensive reference table for developers and system administrators.
What Are DNS Records?
DNS records are instruction sets stored on authoritative DNS servers that map human-readable domain names to machine-readable IP addresses and other resources. Think of DNS as the internet phone book: when you type a domain name in your browser, DNS records tell your computer where to find it.
The DNS resolution process works in four steps:
- Browser check: Your browser checks its local DNS cache for a recent lookup
- Resolver query: If not cached, the browser asks your ISP DNS resolver
- Root server: The resolver queries the root server for the TLD authority
- Authoritative answer: The authoritative nameserver returns the DNS record
A Records (IPv4 Addresses)
A records are the most fundamental DNS record type. They map a domain name directly to an IPv4 address. When a user visits your website, the DNS system uses the A record to find the server IP address.
; A record example example.com. 3600 IN A 93.184.216.34 ; Domain TTL Class Type IPv4 Address
Most domains have multiple A records for redundancy and load balancing. DNS servers return all A records, and the client chooses one (typically the first one).
AAAA Records (IPv6 Addresses)
AAAA records serve the same purpose as A records but for IPv6 addresses. With IPv6 adoption growing, every production domain should have both A and AAAA records to ensure compatibility with all networks.
; AAAA record example example.com. 3600 IN AAAA 2606:2800:220:1:248:1893:25c8:1946
MX Records (Mail Exchange)
MX records specify the mail servers responsible for receiving email for a domain. Without MX records, email delivery to your domain will fail. Each MX record has a priority value (lower = higher priority).
; MX record example (multiple mail servers for redundancy) example.com. 3600 IN MX 10 mail1.example.com. example.com. 3600 IN MX 20 mail2.example.com. ; Priority 10 is tried first, priority 20 is backup
CNAME Records (Domain Aliases)
CNAME records create aliases from one domain name to another. Instead of pointing to an IP address, a CNAME record points to another domain, which is then resolved.
Important CNAME Limitation
You cannot use a CNAME record at the zone apex (root domain). For example, you cannot CNAME example.com to another domain. You must use an A record for the root, and CNAME subdomains (www, blog, api, etc.).
TXT Records (Text Data)
TXT records store arbitrary text data associated with a domain. They are primarily used for email security (SPF, DKIM, DMARC) and domain verification.
SPF (Sender Policy Framework)
v=spf1 include:_spf.google.com ~all
Authorizes mail servers
DKIM (DomainKeys)
v=DKIM1; k=rsa; p=MIIB...
Email signing key
DMARC
v=DMARC1; p=reject; rua=...
Mail authentication policy
NS Records (Name Servers)
NS records specify the authoritative name servers for a domain. These are the DNS servers that hold the definitive DNS records for your domain. You typically have at least two NS records for redundancy.
SOA Records (Start of Authority)
The SOA record contains essential administrative information about a DNS zone, including the primary name server, the responsible party email, and timing parameters for zone transfers.
PTR Records (Reverse DNS)
PTR records perform reverse DNS lookups, mapping an IP address back to a domain name. This is the opposite of A records. PTR records are critical for email deliverability because many mail servers verify that the sending IP has a valid PTR record.
Complete DNS Record Reference
| Type | Full Name | Purpose | Recommended TTL |
|---|---|---|---|
| A | Address | IPv4 address mapping | 1-4 hours |
| AAAA | IPv6 Address | IPv6 address mapping | 1-4 hours |
| CNAME | Canonical Name | Domain alias | 6-12 hours |
| MX | Mail Exchange | Email servers | 6-12 hours |
| TXT | Text | Text data (SPF, DKIM, DMARC) | 1-6 hours |
| NS | Name Server | Authoritative DNS servers | 24-48 hours |
| SOA | Start of Authority | Zone administration | 24-48 hours |
| PTR | Pointer | Reverse DNS (IP to domain) | 24-48 hours |
| SRV | Service | Service discovery (port) | 6-12 hours |
| CAA | CA Authorization | Allowed certificate authorities | 24 hours |
To query any of these records, use the Ops.Tools DNS Lookup tool or the DNS Lookup API.
Frequently Asked Questions
Q: What are DNS records?
DNS records are instructions stored in DNS servers that map domain names to IP addresses, mail servers, and other resources. They are the fundamental building blocks of internet navigation, translating human-readable domain names into machine-readable addresses.
Q: What is the difference between A record and CNAME record?
An A record maps a domain directly to an IPv4 address. A CNAME record maps a domain to another domain name (which then resolves to an IP). CNAME cannot be used at the zone apex (root domain), only on subdomains like www, blog, or api.
Q: What is reverse DNS lookup?
Reverse DNS lookup (PTR record) maps an IP address back to a domain name. While regular DNS maps domain to IP, reverse DNS does the opposite. It is commonly used for email deliverability verification and security auditing.
Q: How long do DNS records take to propagate?
DNS propagation depends on the TTL (Time to Live) value. After making changes, propagation typically takes 1-24 hours but can take up to 48 hours. Lowering TTL before making changes speeds up propagation. After propagation, restore the original TTL.
Q: How do I find my DNS records?
Use the Ops.Tools DNS Lookup tool to find DNS records for any domain, or use command-line tools like nslookup or dig. For programmatic access, use the DNS Lookup API.
Related Articles
DNS Propagation Check: How to Track DNS Changes Globally
Understand DNS propagation timing, TTL values, and how to verify DNS changes across global servers. Step-by-step guide for zero-downtime DNS updates.
Read ArticleSSL Certificate Checker: Complete Guide to SSL Verification
Learn how to check SSL certificate validity, understand SSL errors, and monitor certificate expiration. Includes automation examples with the Ops.Tools API.
Read ArticleDNS Lookup API: How to Check DNS Records Programmatically
Complete developer guide to querying DNS records via API. Includes working code examples in Python, Node.js, Go, and PHP with caching best practices.
Read ArticleLook Up DNS Records for Any Domain
Query A, AAAA, MX, CNAME, TXT, NS, and more with our DNS Lookup tool. Plans from $29/month.