CNAME records: what they are and how to add one
How a CNAME makes one name an alias of another, the rules that trip people up, and how to add a CNAME record in DirectAdmin.
On this page
A CNAME (canonical name) record makes one name an alias of another. Whatever the target name resolves to, the alias resolves to as well.
www.yourdomain.co.uk. 3600 IN CNAME yourdomain.co.uk.Common uses
wwwas an alias of the bare domain- Connecting a subdomain to a third-party service, such as
shoppointing at a hosted shop platform orstatusat a status page provider - Verification records some services ask for
The rules
- No CNAME at the bare domain. The root (
@) must use A records, because a CNAME can’t coexist with the MX and NS records the root needs. - Nothing else on the same name. A name with a CNAME can’t also have an MX, TXT or A record.
- The target is a name, not an IP address. Use an A record for addresses.
- Mind the trailing dot. Enter the target as the service instructs; a fully qualified target ends with a dot.
Adding a CNAME in DirectAdmin
- Open Account Manager › DNS Management and select your domain.
- Choose Add Record, type CNAME.
- Name: the alias, such as
shop. - Value: the target name, such as
shops.example-platform.com.(with the trailing dot for an external name). - Save.
Checking it
dig shop.yourdomain.co.uk CNAME +shortIf a CNAME won’t save, there’s usually already another record with that name. Remove or rename it first.
Prefer to follow along?
- Add a DNS record and prove it works
Intermediate · 15 min
If it doesn’t work
These guides cover the most common problems, starting with what you can see. Or browse every fix for a common problem.
- DNS changes not workingYou changed a DNS record and nothing happened. How to tell whether it’s caching, the wrong DNS provider, a naming mistake or a conflicting record.
- Domain not resolving: “This site can’t be reached”Fix DNS_PROBE_FINISHED_NXDOMAIN and ‘server not found’: check the domain is registered, nameservers are set, records exist and DNSSEC isn’t broken.
- Email stopped working after changing nameserversWhy mail stops when you move a domain’s DNS, and how to restore Microsoft 365, Google Workspace or old-host email records at Traxio.
Common questions
What is a CNAME record?
A CNAME record points one name at another name rather than at an IP address. www.example.com CNAME example.com means “look up example.com and use whatever answer you get”, so the two stay in step automatically.
This is a general web-hosting explanation, not specific to Traxio.
The rule that catches people out: you cannot put a CNAME on the root of a domain (example.com itself) alongside other records. Use an A record there and a CNAME on www if you want them linked.
Spotted something out of date or unclear? Tell us and we’ll fix it.