A CNAME (canonical name) record declares that a hostname is an alias for another hostname. A resolver that finds a CNAME restarts the lookup at the target name and returns whatever records it finds there.
Why it matters
CNAMEs let you point www or shop at a provider such as a CDN, hosting platform or e-commerce service without tracking their IP addresses. When the provider changes servers, your site follows automatically. The trade-off is a hard rule: a name that has a CNAME cannot have any other record type at the same name, which is why a CNAME cannot sit at the zone apex, where SOA and NS records must live.
Example
www.example.com. 300 IN CNAME example.myshopify.com.
dig www.example.com returns the CNAME followed by the A records of example.myshopify.com.
Common mistakes
- Putting a CNAME at the root domain. Use an ALIAS/ANAME or CNAME-flattening feature if your DNS host offers one.
- Adding a CNAME next to an existing MX or TXT record on the same name, which is invalid and behaves unpredictably.
- Pointing MX or NS records at a name that is itself a CNAME.
- Leaving a CNAME to a deprovisioned service, which opens a subdomain takeover.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.