DNS Records Explained: A, CNAME, MX, and More

DNS records explained: A, CNAME, MX, and what they do, plus the constraints no beginner guide covers, like why CNAME can't point to an MX record.
DNS Records Explained: A, CNAME, MX, and More

Table of Contents

DNS Records Explained: A, CNAME, MX, and More

DNS Records Explained: A, CNAME, MX, and What They Do

DNS records explained simply: they’re instructions stored in a zone file, a configuration file on an authoritative DNS server, telling the internet where a domain’s traffic, email, and services should go. Most guides list the record types and stop there. The part that actually trips up administrators is the constraints between them, like why a CNAME record can never point to an MX record, a rule buried in RFC standards that causes real configuration failures.

What Are DNS Records

A DNS record is a single instruction inside a zone file on an authoritative nameserver, the server responsible for holding the official records for a domain. Each record type serves a distinct purpose, and a domain typically needs several working together, not just one.

A and AAAA Records: Address Records

A Records Point to IPv4 Addresses

An A record maps a domain name directly to an IPv4 address, the numeric address format like 192.0.2.1 that identifies a server. This is the most fundamental record type, since it’s what lets a browser turn a typed domain name into an actual server location.

AAAA Records Point to IPv6 Addresses

An AAAA record does the same job as an A record but maps to an IPv6 address instead, the newer, longer address format built to handle the internet running out of IPv4 addresses. AAAA records are increasingly required as more networks, especially mobile carriers, prioritize IPv6 by default.

CNAME Records: Canonical Name Aliases

A CNAME record aliases one domain name to another domain name, rather than to an IP address directly. This makes CNAME records useful for subdomains and CDNs, content delivery networks that serve site assets from a domain the CDN provider controls, since the CDN can change its underlying IP addresses without you having to update your DNS.

The Root Domain Limitation

Most DNS providers prohibit placing a CNAME record on the root domain, meaning the naked domain like example.com without any subdomain prefix. This exists because the root domain typically also needs other records, like MX and TXT, and DNS standards don’t allow a domain to have a CNAME alongside other record types at the same name. The practical workaround is using an A record on the root domain instead, or a provider-specific alias record that behaves like a CNAME while bypassing this restriction.

Why a CNAME Cannot Point to an MX Record

This is the constraint most beginner guides skip entirely. Standards explicitly forbid an MX record from pointing to a domain that itself is a CNAME. The mail server’s domain must resolve directly to an A or AAAA record. If you point MX at a CNAME target, mail delivery can fail or behave unpredictably, because mail servers performing the lookup expect a direct address resolution, not another alias to follow.

MX Records: Mail Exchange

An MX record directs email addressed to your domain toward a specific mail server. Any domain that needs to receive email needs at least one MX record, and as covered above, that record must point to an A or AAAA record, never to a CNAME.

NS, SOA, and TXT Records

NS Records: Nameserver Delegation

An NS record specifies which nameservers are authoritative for a domain, meaning which servers hold the official, trusted copy of that domain’s DNS records.

SOA Records: Zone Administration

An SOA record, or Start of Authority record, stores administrative information about a DNS zone, including which nameserver is primary and how often secondary servers should check for updates.

TXT Records: Verification and Email Authentication

A TXT record stores arbitrary text, most commonly used today for email authentication standards like SPF, DKIM, and DMARC, which help receiving mail servers verify that an email claiming to be from your domain is legitimate and not spoofed.

DNS Record Mastery: Comparing the Core Types

Record TypePrimary PurposeCritical ConstraintCommon Gotcha
APoints domain to an IPv4 addressMust point directly to an IPCan coexist with an MX record on the root domain
AAAAPoints domain to an IPv6 addressMust point directly to an IPv6 addressIncreasingly required for mobile network compatibility
CNAMEAliases one domain to another domainCannot be placed on the root domainCannot be the target of an MX record
MXDirects incoming email to a mail serverMust point to an A or AAAA recordPointing it to a CNAME can break mail delivery

How DNS Resolution Works: The Journey From Browser to IP Address

The Cache Checks Come First

Before any network request happens, your browser checks its own application cache for a recently resolved copy of the domain. If nothing is found there, your operating system checks its own separate DNS cache next.

The Recursive Resolver Takes Over

If neither cache has an answer, the request goes to a recursive resolver, the server, often run by your ISP or a public provider, that does the actual work of tracking down the answer on your behalf. The recursive resolver is the unsung part of this process most guides skim past, since it doesn’t just make one request. It queries a root nameserver first, then a TLD nameserver, the server responsible for a top-level domain like .com or .org, and finally the authoritative nameserver for the specific domain, before it can return an answer.

The Scale Behind Root Servers

The root nameserver layer isn’t a single server. It runs as 13 root server clusters, distributed globally through anycast routing, a network technique that routes a query to the nearest available server instance rather than one fixed location, across nearly two thousand server instances worldwide. This distributed design is what lets root-level DNS queries handle global traffic without a single point of failure.

TTL and Propagation: What’s Actually Happening

TTL, or time to live, is a value on each DNS record that tells resolvers how long to cache that answer before checking again. Setting TTL too low means resolvers query your nameservers far more frequently, increasing load. Setting it too high means any change you make, like updating an A record after migrating servers, takes longer to reach users worldwide, since cached copies keep being served until they expire. A common practical approach is lowering TTL temporarily before a planned change, then raising it again once the change has fully propagated.

FAQ

Can I use a CNAME record on my root domain?

Most providers don’t allow it, since the root domain typically needs to coexist with other record types like MX and TXT, which standard CNAME rules don’t permit. An A record is the typical workaround.

Why did my email stop working after I set up a CNAME?

If your MX record points to a domain that is itself a CNAME, mail delivery can fail, since MX records are required to resolve directly to an A or AAAA record.

How long does a DNS change take to go live everywhere?

It depends on the TTL set on the record before the change. Lower TTL values propagate faster, often within minutes, while higher TTL values can take hours since cached copies remain valid until they expire.

Picture of Tanzeel Ali

Tanzeel Ali

Ali is a WordPress developer and independent tech educator who built ExplainTheWeb to make the hidden side of the internet understandable for everyone. With years of hands‑on experience building and troubleshooting websites, he focuses on explaining DNS, web hosting, app tracking, and online privacy in plain, jargon‑free language. Every article on this site is written by him — no AI, no content farms, just real explanations from someone who remembers what it’s like to be confused by technical jargon.

Continue Reading

What Is Managed WordPress Hosting? 2026 Guide

Managed WordPress hosting isn't one thing. It's a spectrum from bare-minimum automation to full...

Does Web Hosting Affect SEO? The Real Answer

Yes, hosting affects SEO, but as a multiplier, not a fix. Bad hosting can undermine great content...

Why Do Hosting Companies Oversell? The Real Math

A single server can hold 400 hosting accounts when it should comfortably serve 100. Here's the...

What Does Google Know About You? Full Breakdown

Google's Gemini can now infer your car's license plate from a photo and your insurance renewal date...