$linuxjunkies
>

CNAME record

also: Canonical Name record

A CNAME (Canonical Name) record is a DNS record type that maps an alias domain name to another domain name (the canonical name), allowing multiple domain names to resolve to the same IP address.

A CNAME record creates an alias in DNS that points to another domain name instead of directly to an IP address. When a user requests the alias domain, the DNS resolver follows the CNAME to find the canonical domain, then resolves that to an IP address.

For example, if you own example.com and want www.example.com to reach the same server, you would create a CNAME record: www.example.com CNAME example.com. Now both names resolve to the same destination.

CNAME records are particularly useful for content delivery networks (CDNs), subdomains, and service migrations. However, CNAME records cannot be used at the apex (root) of a domain—only A or AAAA records work there, which is why many services support ALIAS records as an extension.

Related terms