Skip to content
Free website migration on every plan, done by our team.Learn more ›
Domains

CNAME vs ALIAS records: pointing a root domain to a service

Why a CNAME can't sit on your root domain, how ALIAS, ANAME and CNAME flattening solve it, and how to point both yourdomain.com and www to a hosted service.

Short answer: A CNAME makes one name an alias of another, but DNS rules don't allow a CNAME on the root (apex) domain because the root needs other records too. ALIAS, ANAME or CNAME flattening, offered by some DNS providers, give root domains the same effect.

The rule

The root domain must carry records such as SOA, NS and often MX. A CNAME can't coexist with other records on the same name, so yourdomain.com can't be a CNAME.

The usual setup

NameRecordPoints to
yourdomain.comA (or ALIAS)Your server or service
wwwCNAMEyourdomain.com or the service host name

ALIAS, ANAME and flattening

These provider features look up the target's IP addresses and answer with A or AAAA records at the root, so you get CNAME-like behaviour without breaking the rules.

When you need this

  • Hosting a site on a platform that gives you a host name rather than an IP.
  • Putting your site behind certain CDNs. See what a CDN is.

If your site is on traditional hosting with an IP address, a plain A record is all you need. See DNS records explained.

Frequently asked questions

Should www or the root be my main address?

Either works; pick one and redirect the other with a 301.

Does a CNAME slow my site down?

It adds a lookup, but the effect is tiny and usually cached.

Ready when you are

Host it where it performs

NVMe speed, offshore privacy and a written SLA — live in minutes on AuroxHost.