CNAME flattening
A DNS provider feature that lets you publish a CNAME-like record at the apex by resolving it server-side and returning A records to the resolver.
CNAME flattening is the workaround for the "you can't put a CNAME at the apex" rule. Your DNS provider stores what looks like a CNAME at the apex, but at query time it follows the CNAME chain itself and returns A records to the resolver, satisfying RFC 1034 while giving you the convenience of a CNAME.
What it solves
Without flattening, your customer trying to point janesbakery.com at your SaaS gets stuck. With flattening, they can write:
janesbakery.com CNAME (flattened) edge.yourapp.com
…and their DNS provider serves the A records of edge.yourapp.com to anyone asking about janesbakery.com.
Provider support
| Provider | Supported | Field name |
|---|---|---|
| Cloudflare | Yes | "CNAME Flattening" (auto for apex) |
| Route 53 | Yes | "Alias" target |
| DNSimple | Yes | "ALIAS" record type |
| DNS Made Easy | Yes | "ANAME" record |
| Google Cloud DNS | No | use Cloud Load Balancer with anycast IPs |
| GoDaddy | No | |
| Namecheap | Yes | "ALIAS Record" |
| Most registrar default DNS | Often no |
When you tell your customer "set a CNAME at the apex," send them this table. Half of them are on a registrar that doesn't support it and will need plan B (use www. + redirect from apex, or switch DNS providers).
How it works under the hood
When a resolver asks the flattening DNS provider "what's the A record for janesbakery.com," the provider:
- Looks up its internal table, sees the flattened entry pointing at
edge.yourapp.com. - Resolves
edge.yourapp.comitself to get its current A records. - Returns those A records to the resolver, with a short TTL so the flattened record can update when your edge IPs change.
The resolver and the end-user's browser never see a CNAME. From their perspective, janesbakery.com just has A records.