A vs CNAME vs ALIAS: Which Record Should Point Your Domain?
Your hosting platform says "point your domain at example.netlify.app". For www that is one CNAME record. For example.com itself it is not allowed — and the workaround has three different names depending on your DNS provider. Here is what each option does and which to pick.
Three ways to point a name
| Record | Value | Allowed at | Who follows it |
|---|---|---|---|
A / AAAA | An IP address | Any name, including the apex | Nobody needs to: the answer is the address. |
CNAME | Another hostname | Any name except the apex and names with other records | The visitor's resolver looks the target up. |
ALIAS / ANAME / flattening | Another hostname | Any name, including the apex | Your DNS provider looks it up and answers with addresses. |
Why the apex cannot be a CNAME
The domain itself must carry SOA and NS records, and often MX and TXT as well. A CNAME may not share its name with any other record (RFC 1034 §3.6.2), so example.com CNAME … is forbidden by the standard — not by your DNS provider being difficult.
A plain A record works at the apex, but then you must know the platform's addresses and update them if they change. Platforms that publish stable addresses (GitHub Pages, Vercel, Netlify's load balancer) let you do exactly that; others only give you a hostname.
How ALIAS and CNAME flattening work
- You save a record at the apex that points to a hostname, as if it were a CNAME.
- When a visitor asks for the apex's A record, your DNS provider looks up the hostname itself.
- It answers the visitor with the resulting addresses, as ordinary A/AAAA records.
- Nothing outside your provider ever sees a CNAME, so the rule is not broken.
| DNS provider | What it is called | How you enter it |
|---|---|---|
| Cloudflare | CNAME flattening | CNAME (apex) |
| Amazon Route 53 | Alias record | A/AAAA + Alias |
| Azure DNS | Alias record set | A/AAAA + Alias |
| DNSimple · NS1 · DNS Made Easy | ALIAS | ALIAS |
| easyDNS · Constellix | ANAME | ANAME |
| Bunny DNS | Flatten (CNAME) | CNAME (apex) |
Trade-offs
- Location. The provider resolves the target from its own servers. A CDN that picks a nearby location from the resolver's address may pick one near the provider instead of near the visitor.
- Not a standard. ALIAS and ANAME are provider features; the ANAME draft never became an RFC. Moving to another provider means re-creating them by hand, and zone transfers do not carry them.
- TTL. The provider decides how long the flattened answer is cached, usually the target's TTL.
- Newer option. An
HTTPSrecord in alias mode (RFC 9460) tells modern browsers where the site lives without breaking the CNAME rule. Support is growing, but older clients ignore it, so keep A/AAAA records too.
; RFC 9460 "alias mode": the apex says where HTTPS really lives
example.com. 3600 IN HTTPS 0 example.netlify.app.Which one to use
- Subdomain (`www`, `shop`, `app`) pointing at a platform: CNAME.
- Apex, platform publishes fixed addresses: A and AAAA with those addresses.
- Apex, platform gives only a hostname: ALIAS/ANAME or CNAME flattening, if your DNS provider offers it — otherwise move DNS to one that does, or point the apex at addresses and redirect to
www. - Anything that receives mail or needs TXT records: never a CNAME.
The apex and www together
The most common setup: the apex gets addresses (or an ALIAS), www gets a CNAME, and the host redirects one to the other so there is a single canonical address:
; the apex: addresses, or ALIAS/flattening if your host gives you a name
example.com. 300 IN A 203.0.113.80
example.com. 300 IN AAAA 2001:db8::80
; www: an alias of the platform
www.example.com. 300 IN CNAME example.netlify.app.www — and redirect the other with a permanent (301) redirect. Search engines then see one site instead of two copies.Frequently asked questions
Is ALIAS the same as CNAME flattening?
They solve the same problem the same way: the provider resolves the target and returns addresses. The name depends on the provider.
Can I use a CNAME for www and an A record for the apex?
Yes, and it is the most common setup. Make sure the host serves both and redirects one to the other.
Does CNAME flattening slow my site down?
Not noticeably. The provider caches the target's answer, and visitors get ordinary A records.
What if my DNS provider has no ALIAS feature?
Use the platform's published IP addresses at the apex if it has them, or move the domain's DNS to a provider that supports flattening.
See the theory in practice — run a CNAME Lookup for your own domain.