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.

How-to guideBeginner2 min readUpdated

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 then 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.

Popular

Tip: press / to search from any pageSee all results