Pointing a subdomain to another server or service: A record or CNAME

You want the main site to stay with us and shop.yourcompany.com to open somewhere else: a shop platform, a status page, an application on a server of yours? That takes one DNS record, for that name only, without touching the rest of the domain. The choice between an A record and a CNAME depends on one question: is the destination a number or a name?

A or CNAME: what were you given?

The destination you were given Record type Example (illustrative values)
An IPv4 address, four numbers separated by dots A shop → 203.0.113.10 (an IP reserved for examples)
An IPv6 address AAAA shop → an address containing colons
A server or service name CNAME shop → the name the service gives you to point at

If the service asks for a CNAME, it is because its address changes without notice and it wants to be the one to change it. If it gives you an IP, use the A. When in doubt, the service always says which of the two it wants.

Creating the record in cPanel

1 Confirm where the domain’s DNS lives. The record is created where the nameservers are, not where the domain was bought. If they are ours, it is in cPanel; if they belong to another provider or to Cloudflare, it is there. See nameservers: what they are and which ones to use with us.
2 In cPanel, open the Zone Editor and, next to the domain, Manage.
3 See whether the name already exists. If the subdomain was created earlier under Domains, cPanel left a record there pointing at this account. Edit that record instead of creating a second one.
4 Choose Add Record, the type (A or CNAME), type just the subdomain name (for example shop) and the destination the service gave you. Save.
5 Confirm from the outside. On Windows, nslookup shop.yourcompany.com at the command prompt; on Linux and macOS, dig shop.yourcompany.com +short. The answer must be the destination you typed. Propagation takes its time: how long DNS changes take to propagate.
A CNAME cannot sit beside another record on the same name. If shop already has an A, delete the A before creating the CNAME. A CNAME is also not used on the domain itself (with no subdomain): there the A applies, or whatever the service says.
Pointing is not enough: the other side must know the name. Almost every service asks you to add your custom domain in its own settings. Without that, the address gets there and the service answers with an error or with its own page, and it is the commonest reason for “I pointed it and it does not open”. The padlock certificate is then issued by that service, not by our server.
Changing a subdomain that is in use? Lower the record’s TTL a few hours beforehand, so the change arrives quickly. See DNS records explained. If the domain’s DNS is on Cloudflare, the route is the one in creating a subdomain on Cloudflare.

Tell us the subdomain and the destination the service gave you, and we will tell you the record to create.

Open a support ticket

SEE ALSO

DNS records explained: A, CNAME, MX, TXT and TTL

How to add another domain or a subdomain

I changed the DNS and nothing shows yet: TTL, cache, and the four places to check

Nameservers: what they are and which ones to use with us

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.60/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?