CNAME

acronym

networking

Stands for: Canonical Name record

A DNS record that makes one name an alias for another.

A Canonical Name record (RFC 1034) points one hostname at another, so lookups follow the chain to the target's real address records. A CNAME cannot coexist with other record types at the same name.

A CNAME says this name is an alias for that name, and the resolver follows it to find the real answer. It exists so that a service can move without every dependent name being edited, which is why content delivery networks and cloud platforms hand out CNAME targets rather than addresses.

The rule that catches everyone is that a CNAME cannot coexist with other records at the same name. That makes it illegal at the zone apex, because the apex must carry SOA and NS records, so the bare domain cannot be a CNAME no matter how much the CDN documentation wishes otherwise. Providers solved this with non-standard workarounds, variously called ALIAS, ANAME or flattening, which resolve the target at the authoritative server and answer with an address instead.

The other cost is latency, since each alias in a chain is another lookup before an answer arrives. Chains also break in ways that are hard to see: a target that stops resolving takes down every name pointing at it, and a dangling CNAME left after a service is decommissioned is a subdomain takeover waiting for someone to claim the abandoned target.

Also known as: cname, CNAME record, alias record

Sources

All glossary entries