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

Frequently asked questions

Free tools for working with CNAME Record

Related terms