How to Add a CNAME Record

A practical guide to creating a CNAME record in cPanel so one hostname aliases to another correctly.

· Updated · 2,743 views

A CNAME (Canonical Name) record makes one hostname an alias of another. It is useful for pointing www to your root domain or directing a subdomain to an external service that gives you a hostname instead of an IP.

Create the CNAME

  1. In cPanel, open Zone Editor and click Manage beside the domain.
  2. Click + Add Record and select CNAME Record.
  3. In Name, enter the alias, for example www or shop.
  4. In Record, enter the target hostname the alias should follow.
  5. Click Add Record.

Example Values

| Field | Value | | ----- | ----- | | Type | CNAME | | Name | www | | Record | yourdomain.com |

Rules to Remember

  • A CNAME cannot exist alongside any other record on the same name. Do not place a CNAME on your root domain.
  • The target should be a hostname, never an IP address. Use an A record when you need to point to an IP.
  • Some services require the target to end with a trailing dot. Follow the exact value the service provides.

Verify It Works

After propagation, confirm the alias resolves to its target:

dig www.yourdomain.com CNAME +short

The output should show the target hostname. If it returns nothing, check for a conflicting record on the same name or a typo in the target value.

Was this article helpful?

Your feedback helps us improve our documentation.

Still Need Help?

Our support team is available 24/7 to assist you.