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

ProviderSupportedField name
CloudflareYes"CNAME Flattening" (auto for apex)
Route 53Yes"Alias" target
DNSimpleYes"ALIAS" record type
DNS Made EasyYes"ANAME" record
Google Cloud DNSNouse Cloud Load Balancer with anycast IPs
GoDaddyNo
NamecheapYes"ALIAS Record"
Most registrar default DNSOften 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:

  1. Looks up its internal table, sees the flattened entry pointing at edge.yourapp.com.
  2. Resolves edge.yourapp.com itself to get its current A records.
  3. 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.

Want this handled for you? Start free with Domainee — 50 custom domains + 100 GB bandwidth, no card.