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
| Name | Record | Points to |
|---|---|---|
| yourdomain.com | A (or ALIAS) | Your server or service |
| www | CNAME | yourdomain.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.



