What is CNAME Record?

A CNAME record is a DNS alias that points one hostname to another name, which is then resolved to the final address.

A CNAME record, short for Canonical Name record, creates an alias from one hostname to another. Instead of pointing to an IP address, a CNAME points to another domain name - the canonical name - and the resolver then looks up that target to find the actual address. It is a way of saying this name is really that name.

CNAMEs are extremely common in practice. They let www.example.com alias to example.com, point a subdomain at a hosting or CDN provider's constantly changing infrastructure, or route a custom domain to a SaaS application. When the target's IP changes, the CNAME keeps working because it references a name rather than a fixed address.

A key rule is that a CNAME cannot coexist with other records for the same name. Because a CNAME says the name is entirely an alias, you cannot put an MX, TXT, or A record at the same hostname. This is why a root domain (the naked apex like example.com) generally cannot use a plain CNAME.

In email, CNAMEs frequently support authentication and tracking: many email service providers ask you to add CNAME records that delegate DKIM signing or branded tracking domains to their systems. Verifying these CNAMEs resolve correctly is part of setting up deliverability with a third-party sender.

Examples

  • www.example.com CNAME example.com - the www alias resolves to the root domain
  • s1._domainkey.example.com CNAME s1.dkim.provider.net - delegated DKIM signing
  • shop.example.com CNAME stores.saasprovider.com - a custom domain on a SaaS platform

Common questions

Can I use a CNAME on my root domain?
Generally no. A CNAME cannot coexist with the MX, NS, and SOA records a root domain requires. Providers offer alternatives like ALIAS or ANAME records to point an apex domain at a name.
Why do email providers ask me to add CNAMEs?
CNAMEs let a provider manage DKIM keys or branded tracking domains on your behalf. Delegating with a CNAME means they can rotate the underlying records without you editing DNS again.
Does a CNAME slow down resolution?
It adds one extra lookup step because the alias must be resolved to its target, but the effect is negligible with caching. The flexibility CNAMEs provide usually outweighs the tiny overhead.

Related tools

Related terms for CNAME Record