A CNAME (Canonical Name) record is a DNS record that makes one hostname an alias of another domain name, so it resolves through that target domain rather than directly to an IP address.

What is a CNAME record used for?

A CNAME record points a hostname, such as www or shop, to another domain name instead of an IP address. When someone visits that hostname, DNS looks up the CNAME target and then looks up the IP address for that target. This adds one extra lookup step, but it means the destination can change its IP address without you having to update your own DNS record.

Common reasons to use a CNAME record include:

A CNAME record only works at the DNS level. It does not redirect visitors or change the address shown in the browser; it simply tells DNS where to continue looking for the correct IP address.

Rules and restrictions for CNAME records

How to add a CNAME record

The steps depend on which control panel your hosting plan uses. You can check this in your welcome email or in the client area.

cPanel

  1. Log in to cPanel and go to the Domains section
  2. Click Zone Editor
  3. Find the domain you want to edit and click Manage, then choose the option to add a record
  4. Select Add CNAME Record
  5. In the Name field, enter the subdomain you want to use, such as shop (cPanel will complete it as shop.example.com)
  6. In the CNAME field, enter the target domain name you want it to point to
  7. Click Add a CNAME Record to save your changes

DirectAdmin

  1. Log in to DirectAdmin and go to Account Manager, then DNS Management
  2. Select the domain you want to edit
  3. Click Add Record
  4. Select CNAME as the record type
  5. Enter the subdomain name, the TTL (time to live, how long the record is cached, commonly 14400 seconds), and the target domain as the value
  6. If you type the target as a fully-qualified domain name, make sure it ends with a dot, for example example.com.
  7. Click Add to save the record

DirectAdmin does not let you edit an existing DNS record directly. To change one, add the new record first, then delete the old one.

Troubleshooting

If you have checked these points and the record still is not resolving correctly, contact Hostking support through live chat or by opening a support ticket from the client area.