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.

Guide2 min readLast updated
On this page
  1. Common uses
  2. The rules
  3. Adding a CNAME in DirectAdmin
  4. Checking it
  5. If it doesn’t work
  6. Common questions

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

  • www as an alias of the bare domain
  • Connecting a subdomain to a third-party service, such as shop pointing at a hosted shop platform or status at 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

  1. Open Account Manager › DNS Management and select your domain.
  2. Choose Add Record, type CNAME.
  3. Name: the alias, such as shop.
  4. Value: the target name, such as shops.example-platform.com. (with the trailing dot for an external name).
  5. Save.

Checking it

dig shop.yourdomain.co.uk CNAME +short

If a CNAME won’t save, there’s usually already another record with that name. Remove or rename it first.

Prefer to follow along?

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.

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.

Keep going