Black Friday: 60% off yearly plans with code BF2026, until November 30. See the deal

Learn

CNAME at the root domain: ALIAS, ANAME and CNAME flattening

A CNAME record cannot be used at the root (apex) of a domain because the apex must hold SOA and NS records, so DNS providers added ALIAS, ANAME or CNAME flattening: the provider resolves the target itself and answers with plain A and AAAA records.

The short answer
  • The workaround happens inside the DNS host, so resolvers only ever see A and AAAA answers.
  • ALIAS, ANAME and flattening are provider features, not DNS standards, and names differ by host.
  • If your host has no such feature, use an A record or point www to the target and redirect the apex.
Try the dns lookupFree, live, no signup

Why does a CNAME fail at the root domain?

  1. 01

    The apex already has required records

    Every zone starts with SOA and NS records at its top name, for example example.com.

  2. 02

    A CNAME excludes other data

    RFC 1034 and RFC 2181 say a name with a CNAME may hold no other records, so a CNAME at the apex would hide the SOA and NS records.

  3. 03

    MX and TXT live there too

    Most domains also publish MX and TXT records at the apex, which would be impossible next to a CNAME.

  4. 04

    Panels refuse or break it

    Some providers reject the record, others accept it and break email or the zone. Both are bad outcomes.

What are the provider alternatives?

Apex aliasing features (names differ by provider)
FeatureHow it behavesDocumented by
CNAME flatteningProvider looks up the CNAME target and returns its IP addresses instead of the CNAMECloudflare
Alias recordPoints the apex at selected AWS resources or another record in the same zone; answers as A or AAAAAmazon Route 53
ALIAS / ANAMEVendor-specific record that resolves a hostname on the DNS server and serves the addressesOffered by several DNS hosts under these names
Plain A recordYou enter the IP address yourself; no provider feature neededAny DNS host

See Cloudflare CNAME flattening and Route 53 alias records.

What should you watch for?

Verification CNAMEs

Cloudflare warns that flattening every CNAME can break third-party domain verification, because the CNAME is no longer returned.

Dangling target

If the target has no A or AAAA records, flattening returns an empty answer that looks like a propagation problem.

TTL and cost differ

Route 53 uses the target default TTL for AWS resources and does not charge for alias queries to AWS resources, while CNAME queries are billed.

How do you point the root domain at a service?

  • Read the service docs: many give an A record IP, an ALIAS target or both for the apex
  • Use ALIAS, ANAME or flattening only if your DNS host documents it
  • Otherwise use an A record, and a CNAME on www pointing at the service
  • Redirect one hostname (apex or www) to the other so both reach the same site
  • Re-check the apex with the DNS lookup after saving; expect A and AAAA, not CNAME

What does an apex setup look like in a zone?

Zone file view; ALIAS syntax is vendor-specific, shown as a comment
; not allowed: CNAME at the apex
; example.com.  CNAME  stores.example-shop.net.   <- rejected or harmful

; standard alternative: A record with the IP from the service
example.com.      3600 IN A      192.0.2.44
; subdomain: normal CNAME
www.example.com.  3600 IN CNAME  stores.example-shop.net.

Common questions

What is an ALIAS record?

An ALIAS record is a vendor feature that behaves like a CNAME but can sit at the root of a domain. The DNS host resolves the target name and answers queries with the resulting A and AAAA records.

What is the difference between ALIAS and CNAME?

A CNAME is a standard record that sends resolvers to another name and cannot share a name with other records. An ALIAS is resolved by the DNS server, so resolvers see ordinary address records and the apex can also have MX and TXT.

What is CNAME flattening?

CNAME flattening is when a DNS provider follows a CNAME chain itself and returns the final IP addresses instead of the alias. Cloudflare uses it to allow a CNAME at the zone apex.

Is ANAME the same as ALIAS?

They do the same job under different names, and providers use whichever label they like. Neither is an official DNS record type, so check your own host documentation for exact behavior and limits.

Watch your domains automatically

Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.