A CNAME record links a subdomain (such as shop.yourdomain.com) to another domain or hostname, without needing to specify an IP address again. This is useful when setting up subdomains for, for example, a webshop, email service, or external application. In this article, you’ll learn exactly what a CNAME record does, how to create one step by step, and which pitfalls to avoid.
What is a CNAME record?
CNAME stands for Canonical Name. It is a DNS record that makes a subdomain point to another hostname, instead of directly to an IP address. When a visitor visits shop.yourdomain.com, the browser first looks up the CNAME record, follows that reference to, for example, shops.supplier.com, and only then retrieves the corresponding IP address.
The big advantage: if the IP address of the target server changes, you don’t need to adjust anything in your own DNS. The CNAME record keeps pointing to the hostname, and that hostname itself manages the link to the correct IP address.
When to use a CNAME instead of an A record?
An A record links a domain or subdomain directly to an IP address. A CNAME links a subdomain to another hostname. Use a CNAME when:
- You want to link a subdomain to an external service, such as a helpdesk tool, email marketing platform, or CDN.
- The target server’s IP address may change regularly, so you don’t have to update the DNS record yourself every time.
- The service provider explicitly requires a CNAME record to be created for verification or linking purposes.
Use an A record instead if you want the subdomain to point directly to a fixed IP address of your own server, for example with web hosting on your own infrastructure.
Step by step: creating a CNAME record
The exact steps differ slightly depending on the control panel, but the principle is the same everywhere. Below is the procedure via Plesk, the panel used by default at Tandata.
Log in to Plesk
Go to your Plesk environment and select the domain for which you want to link a subdomain.
Open the DNS settings
Click ‘DNS Settings’ in your domain’s menu to open the overview of existing DNS records.
Add a new record
Choose ‘Add Record’, select CNAME as the type, and enter the desired subdomain under hostname, for example shop.
Enter the target hostname
Under ‘canonical hostname’, enter the full hostname that the subdomain should point to, including a trailing dot if required.
Save and wait for propagation
Confirm the record. DNS changes may take some time before they are visible everywhere.
Common mistakes and how to fix them
A few things often go wrong when setting up a CNAME record:
- Combining a CNAME with other records on the same subdomain. This is not allowed: a hostname with a CNAME record cannot have any other record (such as MX or TXT).
- Forgetting the trailing dot at the end of the hostname. Some panels require a trailing dot to indicate that it is a fully qualified domain name.
- Using a CNAME on the root domain. This is technically not allowed; use an A record or ALIAS record instead.
- Testing too quickly. DNS changes are not always immediately active everywhere, so give it some time before concluding that something isn’t working.
Do you also need business email on the same domain alongside the subdomain? Then make sure the MX records are kept separate from your CNAME settings; see our page on business email for more information. If you want to register a new domain to set up subdomains on, check out the options at domain names.
Frequently Asked Questions
Can I create multiple CNAME records for the same subdomain?
No, a subdomain can only have one CNAME record and no other type of record alongside it.
How long does it take before a CNAME record is active?
This depends on DNS propagation and the TTL value of the record, but expect some time before the change is visible everywhere.
Can I use a CNAME for my root domain?
No, this is not allowed according to the DNS standard. Use an A record for the root domain instead.
Where do I set up a CNAME record if I host with Tandata?
This is easily done via DNS management in Plesk, as described in the step-by-step guide above.
I’m not sure if my CNAME is set up correctly, what now?
Check the record with a DNS lookup tool or consult the knowledge base for more information, or contact support.
Conclusion
Creating a CNAME record for a subdomain is a matter of choosing the correct record type in your DNS management, entering the hostname, and setting the target hostname correctly. Be careful not to combine other records with a CNAME, and give the change time to become active everywhere. If in doubt, always check with a DNS lookup tool.