Skip to content

CNAME records and the rules that come with them

Up to date as of 28 November 2026

A CNAME record makes one name an alias for another. The row says "this name is just another way of saying that name". Anyone who looks up the alias gets sent on to the second name and uses its answer.

The standard says "A CNAME RR identifies its owner name as an alias".1 The value is the canonical, meaning the main, name.

When one makes sense

Your web host or a service you use may give you a name instead of a number. Something like a long address ending in the company's own domain. You add a CNAME for www, or for a subdomain such as shop, and point it at that name.

The benefit is that the service can move its servers without you doing anything. You hold a pointer, not an address. The old specification calls CNAMEs "useful (and encouraged) for generalized names for servers", such as a name for the web server.2

How an alias gets followedSomeone looks up shop.example.comDNS finds a CNAME for that nameIt names the host's own addressDNS looks up that name's A record
The alias holds no address of its own. It sends the lookup on to the real name.

What you'll see in your settings

A CNAME row has a name, the type CNAME, and a value that's another domain name, not a number. If the value looks like numbers and dots, you want an A record instead.

Follow the format your provider shows for the value, since forms differ on small details.

The rules

CNAMEs are strict. Break a rule and the record may be refused or ignored.

  • One alias, one target. The standard says there may be only one "such canonical name for any one alias".3
  • A CNAME can't share its name with other records. "A CNAME record is not allowed to coexist with any other data." That means no A, MX or TXT row on the same name.2
  • The standard states the same thing from the other side: "If a CNAME RR is present at a node, no other data should be" there.1
  • An MX or NS record's value "must not be an alias", so don't point mail or nameserver rows at a CNAME.3
  • If you remove the host, remove the alias too. The old guidance says "Don't forget to delete the CNAMEs associated with a host if you" delete that host.2

Why the bare domain can't have one

The bare domain, like example.com with nothing in front, is the top of your zone. The terminology document calls it the apex: "The point in the tree at an owner of an SOA" record.4 It holds the NS records too.

So the bare domain always carries other rows. And a CNAME can't sit beside any of them.

The old guidance even uses this as an example of a mistake. It describes someone putting NS records and a CNAME on the domain itself. The server software refuses to add the other records once it sees the CNAME.2

What you may notice in practice: you try to add a CNAME on the bare name and your provider says no. If your provider offers something else for this case, read its own help page before using it.

For the bare name, use an A or AAAA record with the address your host gives you. For www, a CNAME is fine. Both appear side by side in the worked example on the zone-reading page: line by line.

Notes and sources

  1. RFC 1034: Domain names, concepts and facilities, IETF (RFC Editor)
  2. RFC 1912: Common DNS operational and configuration errors, IETF (RFC Editor)
  3. RFC 2181: Clarifications to the DNS specification, IETF (RFC Editor)
  4. RFC 8499: DNS Terminology, IETF (RFC Editor)