Warning: session_start(): open(/tmp/sess_r0vql9sjon4179iqrfmmbrifmb, O_RDWR) failed: No space left on device (28) in /www/wwwroot/snooptool.com/answers/what-is-a-cname-record/index.php on line 2

Warning: session_start(): Failed to read session data: files (path: ) in /www/wwwroot/snooptool.com/answers/what-is-a-cname-record/index.php on line 2
CNAME vs A Record: What Each One Does and Why Your Apex Domain Cannot Be a CNAME | SnoopTool
SnoopTool
Domains and DNS

What is a CNAME record, and how is it different from an A record?

CNAME and A records look interchangeable until the day you try to put a CNAME on your root domain, and your provider refuses, and nobody can tell you why.

A CNAME (Canonical Name) record points one host name at another host name; an A record points a host name at an IPv4 address. The rule that matters in practice is that a name with a CNAME cannot have any other record of any type — so you cannot put a CNAME on the apex of your domain, because the apex must already carry NS and SOA records. That is why www.example.com can be a CNAME and example.com cannot, and why providers offer ALIAS, ANAME or “CNAME flattening” to fake the effect at the apex.

Worked out 2026-09-11 (IST) · standard DNS behaviour as specified in RFC 1034 and RFC 2181

The record types you will actually meet

What each record answers
RecordQuestion it answersValue it holds
AWhat IPv4 address serves this name?93.184.216.34
AAAAWhat IPv6 address serves this name?2606:2800:220:1:248:1893:25c8:1946
CNAMEWhat other name should I look up instead?target.example.net.
MXWhich server takes email for this domain?10 mail.example.com.
NSWhich name servers are authoritative here?ns1.example.com.
TXTWhat arbitrary text is published here?v=spf1 include:_spf.google.com ~all
SOAWho owns this zone and how should it be cached?Serial, refresh, retry, expire, minimum
SRVWhich host and port run this service?_sip._tcp 10 60 5060 sip.example.com.
CAAWhich certificate authorities may issue for this name?0 issue "letsencrypt.org"

The coexistence rule, stated exactly

What may sit alongside what
At one nameAllowed?Why
A + AAAAYesDifferent address families for the same host
A + TXTYesTXT carries verification strings, not addressing
A + MXYesA web server and a mail route can share a name
CNAME + anything elseNoRFC 1034: a CNAME replaces the name entirely
CNAME at the zone apexNoThe apex must carry NS and SOA
CNAME at a subdomainYesNothing else is required to exist there
CNAME pointing at a CNAMELegal but discouragedEach hop costs a lookup; resolvers cap the chain

What to use, when

Decision table
You want toUse
Point www at a hosting platform that gives you a host nameCNAME on www
Point your root domain at a platform that gives you a host nameALIAS/ANAME, or the platform's A records
Point a name at a fixed server you controlA record (plus AAAA if you have IPv6)
Verify ownership with Google, Microsoft or a SaaS toolTXT record, occasionally a CNAME they specify
Send visitors from an old domain to a new oneHTTP 301 redirect, not DNS
Restrict which CA may issue certificates for youCAA record

Whatever you change, the wait afterwards is set by the TTL on the record you replaced, not by how fast your provider applies the edit.

Sources: IETF RFC 1034 and RFC 1035 (domain names), RFC 2181 (clarifications to the DNS specification), RFC 5321 (SMTP) and RFC 7505 (null MX).

Check your own numbers

See which of a domain's names are aliases and which resolve directly.

Frequently asked

Why does my DNS provider refuse a CNAME on the root domain?

Because the root of your zone already has NS and SOA records, and RFC 1034 forbids a CNAME from coexisting with any other record at the same name. It is not a limitation of your provider - a zone that broke that rule would be rejected or would resolve inconsistently. Providers that appear to allow it are running ALIAS or CNAME flattening, which resolves the target on their side and publishes a normal A record.

Is a CNAME slower than an A record?

Marginally, and almost never enough to notice. A CNAME costs the resolver one extra step because it must look up the target after following the alias, though most authoritative servers return both in a single response. Chained CNAMEs - an alias pointing at another alias - are the version worth avoiding; each hop is another round trip and resolvers cap how many they will follow.

Can an MX or NS record point at a CNAME?

No. RFC 2181 is explicit that MX and NS targets must be real host names with address records, not aliases. Doing it anyway produces intermittent failures: some senders and resolvers follow the alias, others treat the record as broken, and you end up debugging a fault that only affects some of your correspondents.

What is the difference between CNAME and a redirect?

A CNAME operates in DNS and is invisible to the browser - the address bar keeps showing the name you typed, and the target server must be configured to answer for it. A redirect operates in HTTP, returns a 301 or 302, and changes the address bar. If you want visitors to end up on a different URL, you want a redirect; if you want a different server to answer for the same URL, you want a CNAME.

Related answers

Need domain and DNS checks inside your own product?

We build WHOIS, RDAP, DNS and SSL lookups as embeddable widgets or a plain JSON API in your branding, wired to your own lead form. Tell us which checks you need and we will send a working demo.