Recommended Services
Supported Scripts
DNS Records Explained: A, AAAA, CNAME, MX, TXT & More

Every time you visit a website, send an email, or connect to a server, the Domain Name System (DNS) quietly does the work of translating a human-friendly name like example.com into the numbers and routing information computers actually use. The instructions that make this happen are called DNS records. Understanding them is essential for launching a site, setting up email, or moving to a new host. This guide explains the most important record types in plain English, with real examples.

What Is a DNS Record?

A DNS record is a single line of instruction stored in your domain’s zone file on a DNS server. Each record has a type (what kind of information it holds), a name (which hostname it applies to), a value (the answer), and a TTL (how long resolvers may cache it). Together, these records tell the internet where to find your website, your mail server, and anything else attached to your domain.

The Essential Record Types

RecordPurposeExample value
APoints a hostname to an IPv4 address203.0.113.10
AAAAPoints a hostname to an IPv6 address2001:db8::1
CNAMEAliases one hostname to anotherexample.com
MXSpecifies the mail server for the domain10 mail.example.com
TXTHolds text data (SPF, DKIM, verification)"v=spf1 mx -all"
NSDelegates the domain to its nameserversns1.host.com
SRVDefines the host and port for a service10 5 443 sip.example.com

A and AAAA Records

The A record is the most fundamental record — it maps a name to an IPv4 address. The AAAA record does the same for IPv6. A typical site has both for the root domain and the www subdomain.

example.com.      3600  IN  A     203.0.113.10
www.example.com.  3600  IN  A     203.0.113.10
example.com.      3600  IN  AAAA  2001:db8::1

CNAME Records

A CNAME points one name at another name rather than an IP. It’s ideal for subdomains that should always follow the root. Note: you cannot place a CNAME on the root domain (the “naked” example.com) alongside other records.

blog.example.com.  3600  IN  CNAME  example.com.
shop.example.com.  3600  IN  CNAME  mystore.myshopify.com.

MX Records

MX (Mail eXchange) records tell other servers where to deliver email for your domain. The number is the priority — lower values are tried first, so you can add a backup mail server with a higher number.

example.com.  3600  IN  MX  10  mail.example.com.
example.com.  3600  IN  MX  20  backup-mail.example.com.

TXT Records

TXT records store free-form text and power email authentication (SPF, DKIM, DMARC) and domain-ownership verification for services like Google and Microsoft.

example.com.  3600  IN  TXT  "v=spf1 include:_spf.google.com -all"
example.com.  3600  IN  TXT  "google-site-verification=abc123..."

Understanding TTL and Propagation

The TTL (Time To Live), in seconds, tells resolvers how long to cache a record before checking again. A low TTL (e.g. 300) means changes take effect quickly but adds more lookups; a high TTL (e.g. 86400) is efficient but slow to update. Before a planned migration, lower the TTL a day in advance so the switch propagates fast.

How to Check DNS Records

# Look up specific record types
dig example.com A +short
dig example.com MX +short
dig example.com TXT +short

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

On Windows you can use nslookup example.com for a quick check.

Conclusion

DNS records are the address book of the internet: A/AAAA point names to servers, CNAME creates aliases, MX routes email, TXT proves identity, and NS delegates the whole domain. Once you can read a zone file and use dig to verify changes, managing your domain — and troubleshooting it — becomes straightforward.

Leave a Reply

Your email address will not be published. Required fields are marked *