How to add a CNAME record
A CNAME points one name at another instead of at an address, and it comes with one hard rule about what else can share its name.
A CNAME record points one name at another name, not at an address. Where an A record says "this name means this IP address", a CNAME says "this name means whatever the target name currently means" — so if the target's address ever changes, the CNAME follows automatically without needing an edit of its own.
Adding one
In the DNS section of your control panel, add a new record and select CNAME as the type. You need two pieces of information:
- The name — the alias you are creating, for example
shopforshop.yourdomain.com, orwwwforwww.yourdomain.com. - The target — the existing name it should point at, written as a full hostname, such as
yourdomain.comor a hostname supplied by a third-party service you are connecting.
www.yourdomain.com. CNAME yourdomain.com.
Leave the TTL at its default unless you are about to make a change you want to spread quickly, in which case see what a DNS TTL is for how lowering it in advance helps.
DNS does not allow a name to hold a CNAME record alongside an A, MX, or TXT record. This is why a CNAME almost never sits on the bare domain (@) itself, since that name usually already carries an A record and often an MX record for email. Put CNAMEs on subdomains instead — www, or a name a third-party service asks you to create.
Where you will actually use one
The most common CNAME on any domain is www pointing back at the bare domain, so that both versions always resolve to the same place without being kept in sync manually. Third-party services also frequently ask you to create a CNAME as proof you control the domain, or to route a subdomain through their platform — a support desk tool, an email marketing sender, or a content delivery network, for example. In every case, copy the exact target hostname the service gives you rather than guessing at a similar-looking one.
Confirming it worked
Query it directly rather than trusting a browser reload, which may be showing you a cached answer:
dig +short CNAME shop.yourdomain.com
nslookup -type=cname shop.yourdomain.com # Windows
The result should be the target hostname you entered. If nothing comes back yet, give it time — CNAME changes generally spread on the same schedule as other record types, covered in how long DNS propagation takes.
A CNAME cannot point at an IP address
If what you have is an IP address rather than a hostname, you need an A record, not a CNAME — a CNAME's target field only accepts a name. This trips people up because both records end up making a subdomain "work", but they solve different problems: an A record hard-codes an address, while a CNAME follows wherever its target currently points.
Related reading
What each DNS record type actually does, in plain terms, and the handful you will realistically ever need to touch.
How to add or edit an A recordWhere to find the A record setting in your DNS zone, what each field means, and how to confirm the change actually took.
How to add a TXT recordA TXT record just holds text for another system to read, most often used to prove domain ownership or authorise a mail sender.
What is a DNS TTL?The number of seconds a DNS answer is allowed to be cached before it has to be checked again, and why it decides how fast a change spreads.