Know more about DNS records
 

How to use the CNAME record?

The CNAME is a great DNS record that will save you plenty of time and effort when you are managing different DNS zones. Use it for your subdomains, and organize the rest of the DNS records from the canonical domain name. How can you do it? Don’t worry. We will explain to you how the CNAME record works.

What is the CNAME record used for?

The CNAME shows that one hostname, like www or another subdomain, is just an alias for the main domain, the canonical domain. This is why it is called CNAME. C stands for canonical.

The CNAME is used exclusively for subdomains. If there are already other DNS records in the zone, you won’t be able to create the Canonical Name record.

How to check CNAME record?

The CNAME is used for pointing multiple hostnames to a single place, the canonical domain. The reason behind it is that if you have the A record of the root domain, meaning the IP address, you will not need to change the A records of each hostname. This is because they are already pointing with CNAME to the right domain name, and the request for the hostnames will return the A record of the root domain.

You can use the CNAME to separate a specific hostname. Usually, people use it to specify a mail subdomain or an FTP subdomain and point to the root domain.

What is the CNAME not used for?

The CNAME is not used to point to another CNAME. Yes, it is possible, but it is not efficient, and it will only take DNS resources. It is a bad DNS practice that you should not use.

CNAME can’t point to an IP address. For that purpose, you will need an A record.

A CNAME record can’t be used for the root domain. For that purpose, you can use a similar DNS record called ALIAS.

How to use the CNAME record?

Whether you are using your own server or a cloud DNS provider, you will have to follow the same process. There will be minor differences, but the essence of the process is the same.

1. Create a new Primary Forward DNS zone for the subdomain you want. A CNAME record can be created only in a Forward zone.

2. Now that you have the environment for the CNAME record, you can create the record itself. When you create a CNAME record, you will need to enter TYPE: CNAME, HOST: the name of the subdomain, POINTS TO: the canonical name, and TTL: the period this record will be valid.

3. Ready!

Now every request for the subdomain will be redirected to the canonical name that you set up.

Conclusion

So, now you know. The real function of the CNAME is to save you time when you are managing multiple subdomains. You need to create CNAME records once, and then, even if the IP address of the root domain to which they are pointing changes, the subdomains will continue to function correctly.

Leave a Reply

Your email address will not be published. Required fields are marked *