The www version of your address and the plain version without www open the same website because one of those names is "forwarded" to the other by a CNAME record, much like call forwarding: you dial number A, and the call is actually sent to number B to be answered. When www, blog.yourcompany.com and shop.yourcompany.com all forward to one target, the real payoff is practical: the next time you switch host or platform, you usually change one place and the rest follow automatically, so you avoid editing each name by hand and avoid the risk of missing one and quietly breaking an address.
Who should read this? ❓
If your company has a website and you have run into any of the following, this is worth a few minutes: you have wondered why www and the plain domain open the same site, you want to add a blog. or shop. subdomain but are not sure how to point it, or someone has asked you to "add a CNAME record" and you are not sure what that is or whether changing it is safe. If none of this applies to you and you do not expect it to, feel free to skip this one.
First, why CNAME records exist at all
To understand a CNAME, it helps to see the problem it was built to solve. Every server on the internet really lives at a string of numbers (an IP address). DNS, the Domain Name System, is the internet's phone book: it translates the memorable domain name you type into that string of numbers so your visitors can find your website.
Here is where it gets awkward. A company often has several names pointing at the same website or the same service: www.yourcompany.com, blog.yourcompany.com, shop.yourcompany.com and so on. If every one of those names listed its own string of numbers, then the day that service moves and its numbers change, you would have to dig out each name and edit it one by one. Miss one, and that address stops working. The CNAME record was designed to solve exactly this "change one place, chase down many" problem. Instead of listing numbers, it forwards one name to another, the canonical name, so they all follow that single canonical name. When the address later changes, you update that one canonical name and every name forwarded to it follows along.
Think of it as call forwarding
The closest everyday comparison for a CNAME is call forwarding: you dial number A, and the call is automatically sent to number B, which answers it. That is what a CNAME does. A visitor types one name into the browser, DNS sees that the name is a CNAME, follows it to the canonical name it forwards to, and that name supplies the real address. The visitor notices nothing; they still see the address they typed.
What a CNAME record actually looks like
When you come to fill one in at your DNS provider, a CNAME record is just a few fields that say "which name forwards to which target":
- Host / Name: the alias you are defining, the "number you dial", such as www, or a subdomain like shop. Some control panels label this field Host, others call it Name.
- Value / Points to: the canonical target hostname it forwards to, the "phone that actually answers", such as yourdomain.com, or a service host a provider gives you like shops.myshopify.com. This field goes by different names depending on the panel: Value, Points to, Alias, or Canonical name all mean the same thing.
- TTL: how long this record may be cached by servers around the world, in seconds. A smaller number means a later change takes effect sooner, at the cost of slightly more frequent lookups.
In GoDaddy, for instance, adding a CNAME roughly looks like this: Add record, choose Type CNAME, put the alias in Name (such as www), put the target host in Value (such as yourdomain.com), then Save. Panels differ, but those are the fields you fill. Two rules are worth knowing up front: the root domain itself (often written as "@", the bare domain with no prefix) generally cannot use a CNAME, and a name that carries a CNAME cannot carry any other record alongside it. Those two are really the same rule.
Why www and the plain domain are the same website
This is the most common use of that forwarding, and the closest to your question. The usual setup is to forward www.yourcompany.com with a CNAME to the plain root domain (yourcompany.com) as the canonical name, so whichever one you type ends up at the same website. The other direction does not work, and the "@ root domain generally cannot use a CNAME" rule above is exactly why: that position has to hold the base records DNS needs to run, and a CNAME cannot coexist with other records, so the root domain usually points at its address through a different record type. Which names can use a CNAME and which cannot is precisely the part you hand to whoever maintains your DNS.
How subdomains like blog. and shop. get pointed around
The same forwarding applies, and this is how many third-party services connect to your domain. A few common cases: a store built on Shopify will ask you to forward shop.yourcompany.com with a CNAME to the host it gives you (such as shops.myshopify.com); a help-desk system, or a CDN (a content delivery network, the service that caches your images and pages closer to visitors so they load faster), mostly works the same way, handing you a host on its side for you to forward to. Some services also have you add a CNAME to verify that a subdomain really is yours, or to connect that subdomain to their system. You simply forward the relevant subdomain to the name the platform gave you, and a visitor reaching your subdomain is sent to the platform to be served. When the platform later upgrades and changes its address, the platform maintains that canonical name; your subdomains keep working and you change nothing.
One easy thing to miss: the record has to go in the right place
One more point gets overlooked: a CNAME only works if you set it at the DNS provider your domain actually resolves through, the one your Name Servers currently point to. If your Name Servers were moved elsewhere some time ago but you edit records back at the old registrar, nothing takes effect and the effort is wasted. For a company without someone watching these settings, simply knowing where to make the change is itself work saved.
A record versus CNAME, so you do not mix them up
These two record types are the easiest to confuse, but the division of labour is clear. An A record points a name straight at the real string of numbers (name to number). A CNAME forwards a name to another name (name to name), and that name then supplies the number. That is also why a single name usually cannot be both an A and a CNAME at once. For when to use which, see our companion article on the difference between A records and CNAME.
What 5U Website does about this
A CNAME is the kind of setting nobody notices when it is right, and that takes down an address or a whole subdomain when it is wrong. Over the past decade and more, we have handled many site moves, new subdomain launches, and connections to third-party blog and store platforms. Our approach is to record the current state before touching any record, decide clearly which name should be the canonical name, work out which addresses a change will affect, and where needed make the change in stages. That keeps out the kind of split failure where the main site is fine but one subdomain will not open.
Let us handle it
You do not need to work out how to fill in a CNAME or which names can use one and which cannot; that is our day job. If your website or one of your subdomains shows odd behaviour like working intermittently or not updating after a change, or if you plan to launch a new blog. or shop. subdomain, send 5U Website an email and we usually reply within one to two business days.
Last updated:
