DNS Records Explained: A Complete Guide with Infographics

DNS Records - Network Server Infrastructure

🌐 DNS Records Explained

A Complete Visual Guide to Domain Name System Records

DNS (Domain Name System) is the internet's phone book — it translates human-readable domain names like example.com into machine-readable IP addresses. DNS records are instructions stored in authoritative DNS servers that provide information about a domain, including what IP address it is associated with, how email should be handled, and more.

🔄 How DNS Resolution Works

👤 User Types
example.com
🖥️ Recursive
Resolver
🌍 Root
Name Server
📂 TLD
Server (.com)
🏠 Authoritative
Name Server
✅ IP Address
Returned

📋 Core DNS Record Types

A

A Record

Address Record (IPv4)

Maps a domain name to a 32-bit IPv4 address. This is the most fundamental DNS record — it tells browsers where to find your website on the internet. A single domain can have multiple A records for load balancing.

# Format: name TTL IN A ip_address
example.com. 3600 IN A 93.184.216.34
www.example.com. 3600 IN A 93.184.216.34
Website hostingLoad balancingRoot domain
AAAA

AAAA Record

Address Record (IPv6)

Maps a domain to a 128-bit IPv6 address. As IPv4 addresses run out, AAAA records are increasingly important. IPv6 offers a vastly larger address space (3.4×10³⁸ addresses vs ~4.3 billion in IPv4).

# Format: name TTL IN AAAA ipv6_address
example.com. 3600 IN AAAA 2606:2800:220:1:248:1893:25c8:1946
IPv6 routingModern networksDual-stack
CN

CNAME Record

Canonical Name Record

Creates an alias from one domain to another. Instead of mapping to an IP directly, CNAME points to another domain name. CNAME cannot be used at the root (apex) domain and should not point to an IP address.

# www points to the root domain
www.example.com. 3600 IN CNAME example.com.
blog.example.com. 3600 IN CNAME myblog.wordpress.com.
SubdomainsAliasesCDN setup
MX

MX Record

Mail Exchange Record

Directs email to the correct mail servers for a domain. Includes a priority value — lower numbers mean higher priority. Multiple MX records provide email redundancy. Must point to a hostname, not an IP.

# Priority Mail Server
example.com. IN MX 10 mail1.example.com.
example.com. IN MX 20 mail2.example.com.
Email routingMail failoverPriority control
TXT

TXT Record

Text Record

Stores arbitrary text data associated with a domain. Used for domain ownership verification, email security (SPF, DKIM, DMARC), and anti-spam policies. Critical for modern email security configurations.

# SPF record example
example.com. IN TXT "v=spf1 include:_spf.google.com ~all"
# Domain verification
example.com. IN TXT "google-site-verification=abc123"
SPFDKIMDMARCVerification
NS

NS Record

Name Server Record

Identifies the authoritative name servers for a domain. These are the servers that hold all the DNS records for your domain. At least two NS records are recommended for redundancy and failover protection.

# Authoritative nameservers
example.com. IN NS ns1.dnsprovider.com.
example.com. IN NS ns2.dnsprovider.com.
DNS delegationZone authorityRedundancy
PTR

PTR Record

Pointer Record (Reverse DNS)

Performs reverse DNS lookups — mapping an IP address back to a domain name. The opposite of an A record. Used primarily for email server verification and network troubleshooting via nslookup or dig.

# Reverse: IP → Domain
34.216.184.93.in-addr.arpa. IN PTR example.com.
# IPv6 reverse lookup
...ip6.arpa. IN PTR example.com.
Reverse DNSEmail verifyDiagnostics
SOA

SOA Record

Start of Authority Record

Contains administrative information about the DNS zone. Every DNS zone must have exactly one SOA record. It specifies the primary name server, the responsible admin's email, and timing parameters for zone replication.

# primary-ns admin-email serial refresh retry expire min-ttl
example.com. IN SOA ns1.example.com. admin.example.com. 2024010101 3600 900 604800 300
Zone authorityZone transferRequired record
SRV

SRV Record

Service Record

Defines location of specific services like VoIP, SIP, XMPP, or Microsoft services. Contains priority, weight, port, and target. Allows services to be discovered automatically without hardcoding server addresses.

# _service._proto.name Priority Weight Port Target
_sip._tcp.example.com. IN SRV 10 20 5060 sip.example.com.
_xmpp._tcp.example.com. IN SRV 5 0 5222 xmpp.example.com.
VoIP/SIPXMPPMicrosoft 365
CAA

CAA Record

Certification Authority Authorization

Specifies which Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your domain. Prevents unauthorized certificate issuance, significantly reducing the risk of fraudulent SSL certificates.

# Only Let's Encrypt can issue certs
example.com. IN CAA 0 issue "letsencrypt.org"
example.com. IN CAA 0 issuewild "comodoca.com"
SSL securityCA restrictionCert control

⏱️ Understanding TTL (Time To Live)

TTL controls how long DNS resolvers cache your record before checking for updates. Shorter TTL = faster propagation but more DNS queries. Longer TTL = faster resolution but slower updates.

300s
5 min — During migration/changes
3600s
1 hour — Standard for most records
86400s
24 hours — Stable, rarely changed
604800s
7 days — Maximum recommended

📊 DNS Record Quick Reference

Record TypePurposePoints ToCan Be Apex?Common TTL
AIPv4 address mappingIPv4 address✅ Yes3600s
AAAAIPv6 address mappingIPv6 address✅ Yes3600s
CNAMEDomain aliasAnother domain❌ No3600s
MXEmail routingHostname + priority✅ Yes3600s
TXTArbitrary text / securityText string✅ Yes3600s
NSName server delegationHostname✅ Yes86400s
PTRReverse DNS lookupHostnameN/A86400s
SOAZone authority infoPrimary NS + params✅ Required86400s
SRVService locationHost + port + weight❌ No3600s
CAASSL certificate authorityCA domain name✅ Yes86400s

💡 Pro Tips & Best Practices

  • Lower TTL before migrations: Reduce TTL to 300s at least 24 hours before making DNS changes — this minimizes downtime during cutover.
  • Always set up SPF, DKIM, and DMARC: These TXT-based records are essential for email deliverability and preventing spoofing of your domain.
  • Use multiple NS records: Always have at least 2 name servers on different networks for redundancy and fault tolerance.
  • Avoid CNAME at apex: Never place a CNAME at your root domain (e.g., example.com). Use A/AAAA records or ALIAS/ANAME records instead.
  • Add CAA records: Even if you're not planning changes, CAA records provide an extra layer of SSL certificate security at no cost.
  • Test with dig or nslookup: Use dig example.com ANY or nslookup example.com to verify your DNS configuration before going live.

Post a Comment

Previous Post Next Post