What Are CNAME Records?¶
CNAME records are a type of DNS record used to point a subdomain to a website address.
When do I use a CNAME record?¶
You will use a CNAME record when you want a subdomain to point to another website address. This will send visitors who visit the subdomain in the CNAME record to a different website address. This will send all requests to the address given and will negate any other DNS records for this domain.
It is not possible to use a CNAME record on just the bare domain (“example.com”). It must be on a subdomain (“something.example.com”). This is a technical constraint of this resource record type.
If you want to point the domain name itself to another website, and not just a subdomain, you need to use an alias record.
Like an ALIAS record, a CNAME record supersedes all other DNS records on the domain. Any other records can be removed since they will be ignored in favor of the CNAME record.
Can I have an example of a CNAME record?¶
Here are a couple examples:
blog 10800 IN CNAME exampleblogname.wordpress.com. www 10800 IN CNAME exampleblogname.wordpress.com.
If your domain name is example.com, the first example above will send visitors who go to blog.example.com to the wordrpess blog at exampleblogname.wordpress.com.
Likewise, the second example will also send visitors who go to www.example.com to the same wordpress blog.
The final dot (.) at the end must be included for the record to function.