DNS — the Domain Name System — is often called the phone book of the internet. Type a domain name, and DNS translates it into the IP address your browser needs to connect to the right server. But DNS is far more than just "domain to IP" mapping. A full DNS zone contains dozens of record types, each controlling a different aspect of how your domain behaves: where email goes, which servers are authoritative, how subdomains point elsewhere, and even security verification strings.

This guide explains every major DNS record type in plain English, with real examples, common use cases, and the TTL (Time To Live) considerations you need to know before making changes.

Look up any domain: Use the Imperial Products DNS Lookup Tool to instantly query any record type for any domain — A, MX, CNAME, TXT, and more. No command line needed.

Quick Reference: DNS Record Types

Record Type Purpose Common Use
AMaps hostname to IPv4 addressPointing your domain to a server
AAAAMaps hostname to IPv6 addressIPv6-enabled servers
CNAMEAlias one hostname to anotherwww subdomain, CDN integration
MXDirects email to mail serversEmail routing (Gmail, Outlook)
TXTArbitrary text stringsSPF, DKIM, DMARC, domain verification
NSDelegates authority to name serversPointing to your DNS provider
SOAStart of Authority — zone metadataAuto-generated, rarely edited manually
PTRReverse lookup: IP to hostnameEmail reputation, security logging
SRVService location recordSIP, XMPP, Microsoft services
CAAAuthorized CAs for SSL certificatesRestricting who can issue certs
DNSKEYDNSSEC public keyDNSSEC validation
DSDNSSEC delegation signerChain of trust between zones

1 A Record — The Foundation

The A record (Address record) is the most fundamental DNS record. It maps a hostname to an IPv4 address. When you type example.com in a browser, the DNS resolver looks up the A record for example.com and gets back something like 93.184.216.34.

Anatomy of an A Record

; Format: hostname  TTL  class  type  value
example.com.       3600  IN     A     93.184.216.34
www.example.com.   3600  IN     A     93.184.216.34

The trailing dot after example.com. denotes the DNS root — it makes the name fully qualified (FQDN). Most DNS management UIs hide this.

Multiple A Records (Round-Robin Load Balancing)

You can have multiple A records for the same hostname. DNS resolvers cycle through them, providing a primitive form of load balancing:

example.com.  60  IN  A  203.0.113.10
example.com.  60  IN  A  203.0.113.11
example.com.  60  IN  A  203.0.113.12

Common A Record Configurations

TTL tip: Before migrating your server, lower the A record TTL to 300 seconds (5 minutes) at least 24 hours in advance. After the migration, you can raise it back to 3600 or higher. This minimizes DNS propagation delays during the cutover.

2 AAAA Record — IPv6

The AAAA record (quad-A) does the same thing as an A record but for IPv6 addresses. IPv6 addresses are 128-bit and written in eight groups of four hexadecimal digits separated by colons.

example.com.  3600  IN  AAAA  2606:2800:220:1:248:1893:25c8:1946

Modern servers should have both A and AAAA records. When a client supports IPv6 (most do), it will prefer the AAAA record. IPv6-only or dual-stack servers benefit from this; IPv4-only servers can safely omit it.

Checking AAAA Records

dig AAAA example.com
nslookup -type=AAAA example.com

You can also use the DNS Lookup Tool and select record type AAAA to check any domain instantly.


3 CNAME Record — Aliases

A CNAME record (Canonical Name) creates an alias from one hostname to another. Rather than pointing directly to an IP address, it points to another domain name, which is then resolved normally.

; www.example.com is an alias for example.com
www.example.com.  3600  IN  CNAME  example.com.

; blog.example.com points to a hosted blogging platform
blog.example.com.  3600  IN  CNAME  myblog.wordpress.com.

; CDN integration — static assets served from a CDN
static.example.com.  3600  IN  CNAME  d1234abcd.cloudfront.net.

Critical CNAME Rules

When to Use CNAME vs. A Record

Use A Record WhenUse CNAME When
You know the exact IP addressYou're pointing to a third-party service with a dynamic IP
You need maximum performance (one lookup)You're aliasing subdomains (www, blog, shop)
Configuring the root domainIntegrating CDNs, Heroku, GitHub Pages, Netlify, etc.

4 MX Record — Email Routing

The MX record (Mail Exchanger) tells the world which mail servers should receive email for your domain. When someone sends an email to hello@example.com, the sending mail server queries the MX records for example.com to find out where to deliver the message.

; Format: hostname  TTL  class  type  priority  mail-server
example.com.  3600  IN  MX  10  mail1.example.com.
example.com.  3600  IN  MX  20  mail2.example.com.

The priority number (also called preference) is critical. Lower numbers have higher priority. If the primary server (10) is unreachable, the sending server falls back to the secondary (20). Equal priorities are used round-robin.

MX Records for Google Workspace

example.com.  3600  IN  MX  1   aspmx.l.google.com.
example.com.  3600  IN  MX  5   alt1.aspmx.l.google.com.
example.com.  3600  IN  MX  5   alt2.aspmx.l.google.com.
example.com.  3600  IN  MX  10  alt3.aspmx.l.google.com.
example.com.  3600  IN  MX  10  alt4.aspmx.l.google.com.

MX Records for Microsoft 365

example.com.  3600  IN  MX  0  example-com.mail.protection.outlook.com.

Important: MX Records Must Point to A Records

The value of an MX record must be a hostname — never an IP address directly, and never a CNAME. The hostname you point to must itself have an A (or AAAA) record resolving to the mail server's IP address.

Troubleshooting email delivery? Use the DNS Lookup Tool to check your MX records and verify they're correct before contacting your email provider's support team. Nine times out of ten, a misconfigured MX record (or missing SPF TXT record) is the culprit.

5 TXT Record — Text and Email Security

The TXT record stores arbitrary text strings in DNS. Originally designed for human-readable notes, TXT records are now the backbone of email authentication, domain verification, and security policy publishing.

SPF — Sender Policy Framework

SPF tells receiving mail servers which IP addresses are authorized to send email on behalf of your domain. Without SPF, spammers can forge your domain in the From header.

; Allow Google Workspace to send for example.com
example.com.  3600  IN  TXT  "v=spf1 include:_spf.google.com ~all"

; Allow Microsoft 365 + a specific IP
example.com.  3600  IN  TXT  "v=spf1 include:spf.protection.outlook.com ip4:203.0.113.10 ~all"

SPF qualifiers:

You can only have one SPF record per domain. If you use multiple email providers, combine them into a single TXT record with multiple include: statements.

DKIM — DomainKeys Identified Mail

DKIM adds a cryptographic signature to outgoing emails. The receiving server verifies the signature against the public key stored in your DNS, proving the email wasn't tampered with in transit.

; DKIM records live at a selector._domainkey subdomain
google._domainkey.example.com.  3600  IN  TXT  "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBA..."

Your email provider generates the DKIM key pair and gives you the TXT record value to add to DNS. The selector (google in the example) is chosen by the provider.

DMARC — Domain-Based Message Authentication

DMARC builds on SPF and DKIM by specifying what to do with emails that fail authentication — and gives you reporting on who's sending email using your domain.

; Quarantine failing emails and send reports to admin@example.com
_dmarc.example.com.  3600  IN  TXT  "v=DMARC1; p=quarantine; rua=mailto:admin@example.com; pct=100"

; Reject failing emails (strictest)
_dmarc.example.com.  3600  IN  TXT  "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"

DMARC policy values: none (monitor only), quarantine (send to spam), reject (block outright).

Domain Verification TXT Records

Services like Google Search Console, GitHub, Cloudflare, and others ask you to add a TXT record to prove you own the domain:

; Google Search Console verification
example.com.  3600  IN  TXT  "google-site-verification=abc123..."

; GitHub ownership verification
_github-challenge-myorg.example.com.  3600  IN  TXT  "abc123..."

6 NS Record — Name Servers

The NS record (Name Server) delegates authority for a domain or subdomain to specific DNS servers. These records tell the internet which servers hold the authoritative DNS records for your domain.

; Your domain's authoritative name servers
example.com.  172800  IN  NS  ns1.cloudflare.com.
example.com.  172800  IN  NS  ns2.cloudflare.com.

NS records are set at your domain registrar (not at your DNS provider). When you move from one DNS provider to another, you update the NS records at your registrar, and DNS propagates globally over 24–48 hours.

Subdomain Delegation

You can delegate a subdomain to a completely different DNS provider:

; Delegate mail.example.com to a separate DNS zone
mail.example.com.  3600  IN  NS  ns1.mailprovider.com.
mail.example.com.  3600  IN  NS  ns2.mailprovider.com.

NS records have very high TTLs (48 hours / 172800 seconds is common) because changing them requires global propagation and breaks resolution if done incorrectly.


7 SOA Record — Zone Authority

The SOA record (Start of Authority) is automatically created with every DNS zone. It contains metadata about the zone: the primary name server, the responsible email address, and timing parameters for zone transfers.

; SOA record format
example.com.  3600  IN  SOA  ns1.cloudflare.com.  dns.cloudflare.com. (
                              2026101901   ; Serial number (YYYYMMDDNN format)
                              7200         ; Refresh — how often secondaries check for updates
                              900          ; Retry — how long after a failed refresh to retry
                              1209600      ; Expire — when secondary should stop responding if primary unreachable
                              300          ; Minimum TTL for negative caching (NXDOMAIN)
                            )

Most DNS providers manage the SOA record automatically. You rarely need to edit it directly. The serial number must be incremented every time you change the zone — many providers use the date-based format (YYYYMMDDNN).


8 PTR Record — Reverse DNS

A PTR record (Pointer record) is the reverse of an A record: it maps an IP address back to a hostname. PTR records live in special reverse lookup zones under in-addr.arpa (IPv4) or ip6.arpa (IPv6).

; Reverse DNS for 203.0.113.10
10.113.0.203.in-addr.arpa.  3600  IN  PTR  mail.example.com.

; IPv6 reverse DNS
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.2.2.0.0.0.8.2.6.0.6.2.ip6.arpa.  300  IN  PTR  example.com.

Why PTR Records Matter

PTR records are controlled by the owner of the IP address block — your hosting provider or ISP — not your domain registrar. You must request PTR record changes through your hosting provider's control panel or support team.


9 SRV Record — Service Location

An SRV record specifies the hostname and port of a service. Unlike A records, SRV records carry port information, making them useful for protocols that need to discover service endpoints dynamically.

; Format: _service._proto.name  TTL  class  type  priority  weight  port  target
_xmpp-client._tcp.example.com.  3600  IN  SRV  5  0  5222  xmpp.example.com.
_sip._tcp.example.com.          3600  IN  SRV  10 20 5060  sip1.example.com.
_sip._tcp.example.com.          3600  IN  SRV  10 10 5060  sip2.example.com.

Fields explained:

SRV records are commonly used by: Microsoft 365 (Autodiscover, Teams federation), SIP/VoIP systems, XMPP instant messaging, Minecraft server discovery, and Kubernetes service meshes.


10 CAA Record — Certificate Authority Authorization

A CAA record specifies which Certificate Authorities (CAs) are authorized to issue SSL/TLS certificates for your domain. This prevents rogue CAs from issuing fraudulent certificates for your domain.

; Only Let's Encrypt can issue certificates for example.com
example.com.  3600  IN  CAA  0  issue "letsencrypt.org"

; Allow wildcard certificates from Let's Encrypt
example.com.  3600  IN  CAA  0  issuewild "letsencrypt.org"

; Send certificate issue notifications to this address
example.com.  3600  IN  CAA  0  iodef "mailto:security@example.com"

CAA tags:

If no CAA records exist, any CA can issue certificates for the domain (the default state). Adding CAA records is a recommended security hardening step.


Understanding TTL — Time To Live

TTL is the number of seconds a DNS resolver should cache a record before re-querying the authoritative DNS server. It appears in every record type.

TTLDurationWhen to Use
601 minuteDuring active migrations — changes propagate fast
3005 minutesPre-migration, or frequently changing records
36001 hourStandard for most records
8640024 hoursStable records that rarely change
17280048 hoursNS records

Lower TTLs mean faster propagation of changes but more load on authoritative DNS servers. Higher TTLs are more efficient and resilient — if your DNS provider goes down, resolvers can serve cached answers for longer.

The migration strategy: Reduce TTL 24–48 hours before a planned change. Make the change. Once you've confirmed it's working, raise the TTL back to a high value. This gives you fast rollback ability during the cutover window.

Querying DNS from the Command Line

Using dig

# Query a specific record type
dig A example.com
dig AAAA example.com
dig MX example.com
dig TXT example.com
dig NS example.com
dig CNAME www.example.com

# Query a specific DNS server (e.g., Google's 8.8.8.8)
dig A example.com @8.8.8.8

# Short output (just the answer)
dig A example.com +short

# Full trace from root servers
dig A example.com +trace

# Query all record types
dig ANY example.com

Using nslookup

nslookup example.com
nslookup -type=MX example.com
nslookup -type=TXT example.com
nslookup -type=NS example.com

Checking PTR (Reverse DNS)

# Reverse lookup an IP address
dig -x 93.184.216.34
nslookup 93.184.216.34

For a faster, no-install approach, use the DNS Lookup Tool — it supports all record types and shows propagation status across multiple resolvers.


Common DNS Misconfigurations

CNAME on the Root Domain

The most common mistake: creating a CNAME for example.com (no subdomain). This violates RFC 1034 and breaks MX, NS, and TXT records for the root. Use an A record or your DNS provider's ALIAS/ANAME feature instead.

Missing SPF Record

Sending email without SPF will cause deliverability problems. Check with: dig TXT yourdomain.com | grep spf

Multiple SPF Records

Having two v=spf1 TXT records causes SPF to fail with a "PermError". Merge all your email providers into a single SPF record.

MX Points to a CNAME

The target of an MX record must be a hostname with its own A/AAAA record, not a CNAME. Many mail servers will reject connections from MX targets that are CNAMEs.

Forgetting to Update PTR After IP Change

After moving to a new server with a new IP, the PTR record on the old IP is no longer relevant, but more critically the new IP needs a PTR record set up with the new hosting provider. Skipping this causes email delivery failures.


Summary

DNS records are the control panel of your domain's presence on the internet. A and AAAA records direct web traffic. MX records route email. CNAME records create flexible aliases. TXT records carry security policies. NS records delegate authority. CAA records lock down who can issue your certificates. Understanding each type — and their constraints — means you can confidently configure any domain setup, debug delivery problems, and make changes safely with proper TTL management.

Bookmark the DNS Lookup Tool for instant record inspection without ever opening a terminal.