Glossary / CNAME record
CNAME record (DNS alias)
A CNAME (canonical name) record makes one hostname an alias of another. Instead of its own IP address it points to another name, in effect saying: "this host is really that host, look up its records". It is useful when several subdomains should point wherever the main domain points.
Check your site
A common example is www.example.com set up as a CNAME to example.com. The DNS resolver sees the alias, follows it to the main domain and reads the A or AAAA record with the real IP there. When the IP changes, you update it in one place and every alias follows automatically.
External services rely on CNAME: connecting a CDN, a store, a landing page or email often requires exactly "create a CNAME to our host". You do not know their IPs, and they can change, so the alias handles that.
The main limit: a classic CNAME cannot be placed on the root domain (example.com with no subdomain), because the root already carries the SOA and NS records. For the root, use an A record or the special ALIAS or ANAME record of your DNS provider.
Example
www.example.com. 3600 IN CNAME example.com.
Common mistakes
- Putting a CNAME on the root domain. This breaks the standard and knocks out email and other records.
- Adding a CNAME next to other records on the same name. A CNAME must be the only record for that host.
- Pointing a CNAME at an IP address. A CNAME accepts only a hostname; an IP address needs an A record.
- Leaving out the trailing dot on the target where the provider requires it, which sends the alias to the wrong place.