en

CNAME (Canonical Name) is a type of DNS record that gives a domain an alias, pointing it to another domain name instead of an IP address. A request to such a name is automatically redirected to the canonical one.

How CNAME works

If blog.example.com has a CNAME record pointing to example.com, the resolver that receives it continues the lookup for example.com — finds its A record (or AAAA) and returns the final address. This lets one canonical domain serve many aliases, and changing the IP address means editing a single place.

Rules of use

CNAME has some important limitations:

  • Alias only — a CNAME cannot be set for the root domain (example.com), usually only for subdomains.
  • Not combinable — a name cannot have a CNAME together with other records (such as MX or TXT).
  • Chains — a CNAME can point to another CNAME, but long chains increase the time to resolve.

CNAME is handy for pointing subdomains at external services and a CDN without tracking their IP addresses by hand.

DNS CNAME record — a domain alias
Learn more

Tag cloud