Websites and Tech

CNAME Record

Also called CNAME, canonical name record

A DNS record that makes one domain name an alias of another, such as pointing www or a shop subdomain at the platform that hosts it.

Quick facts: CNAME Record

Category
Websites and Tech
Also called
CNAME, canonical name record
Level
Intermediate
Affects
Website availability, platform connections, email authentication, subdomain security
Where to see it
Your DNS provider's dashboard, DNS lookup tools such as dig, platform domain settings
In this article4
  1. How a CNAME record works
  2. Why it matters
  3. Common mistakes
  4. How to act on it

A CNAME record (short for canonical name record) is an entry in your domain’s DNS that points one name at another name, rather than at a server’s numeric address. It says, in effect, “this address is an alias; go and look up that one instead”.

How a CNAME record works

Say your online shop runs on Shopify and you want it at www.yourshop.co.uk. You add a CNAME record for www pointing at the hostname Shopify gives you. When a visitor types your address, their device asks DNS where www lives, is told it is an alias for Shopify’s hostname, then looks that name up to find the actual server. The extra step takes a fraction of a second.

The advantage is that you never need to know the platform’s server addresses. If Shopify, Squarespace or your CDN moves its servers, it updates its own records and your CNAME keeps working. An A record, by contrast, holds a fixed IP address that you must change yourself whenever the server changes.

Two rules catch people out:

  • No CNAME at the root. The bare domain (yourshop.co.uk with nothing in front) cannot be a standard CNAME, because it must also hold the domain’s SOA and NS records, and usually MX records for email. Some DNS providers offer a workaround called CNAME flattening, or an ALIAS record, which behaves similarly.
  • A CNAME stands alone. A name with a CNAME cannot hold any other record type, so you cannot add a TXT or MX record alongside it on the same name.

Beyond websites, CNAMEs often connect custom tracking domains for email marketing tools, and some email services, including Microsoft 365, use them to publish DKIM keys that prove your messages are genuine.

Why it matters

DNS changes are usually the riskiest five minutes of a website launch or platform move. A CNAME pointing at the wrong place, or a typo in the target, can take the site or your email offline, and because DNS answers are stored for a period set by the TTL, fixing the mistake does not take effect immediately everywhere.

Forgotten CNAMEs are a security issue too. If a subdomain such as offers.yourbusiness.co.uk still points at a landing page service you cancelled years ago, someone else can sometimes claim that account and publish their own content on your subdomain. This is called a subdomain takeover, and it trades on your brand’s name.

Common mistakes

  • Trying to put a CNAME on the root domain and breaking email in the process.
  • Typing “https://” or a page path into the target field; a CNAME target is a bare hostname only.
  • Editing DNS at the registrar when the nameservers point to Cloudflare or a host, so the changes are silently ignored.
  • Making changes without lowering the TTL first, then waiting hours for a mistake to clear.
  • Leaving CNAMEs in place for tools and campaigns that ended long ago.

How to act on it

First, find out where your DNS is actually managed by checking which nameservers the domain uses. Before any change, export or screenshot the full list of records, so you can put things back if needed.

If you are planning a move, lower the TTL on the records involved a day ahead, make the change, then check it with a DNS lookup tool rather than just your own browser. Once a year, review every subdomain and delete CNAMEs that point at services you no longer pay for.

DNS is where a platform switch most often goes wrong, so I plan and check these records as part of website migration SEO, alongside redirects and tracking.

Do and do not

Do

  • Record every DNS entry before changing anything
  • Lower the TTL a day before a planned move
  • Delete CNAMEs pointing at cancelled services

Do not

  • Put a standard CNAME on the root domain
  • Add https:// or a path to the target
  • Edit DNS at the registrar if the nameservers point elsewhere

Questions people ask about this

What is the difference between a CNAME and an A record?

An A record points a name directly at a server's IP address. A CNAME points a name at another name, which is then looked up to find the address. Use a CNAME when a platform gives you a hostname to point at, and an A record when you are given an IP address.

Can I use a CNAME for my root domain?

Not as a normal CNAME, because the root domain must also hold its SOA and NS records, usually MX records for email too, and the DNS rules do not allow those alongside a CNAME. Some DNS providers offer CNAME flattening or an ALIAS record that gives the same effect. Otherwise, point the root at the platform's IP address with an A record and redirect it to www.

How long does a CNAME change take to work?

Often minutes, sometimes a few hours. It depends on the TTL of the old record, because devices and internet providers may keep the previous answer until that time runs out. Lowering the TTL a day before a planned change shortens the wait.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.