CNAME is a Canonical Name Record or Alias Record.
A type of resource record in the Domain Name System (DNS), that specifies that one domain name is an alias of another canonical domain name.
Any system hosting a Web site must have an IP address in order to be connected to the World Wide Web.
The DNS resolves the system’s domain name to its IP address, but sometimes more than one domain name resolves to the same IP address, and this is where the CNAME is useful.
A machine can have an unlimited number of CNAME aliases, but a separate CNAME record must be in the database for each alias.
This helps in multiple servers like FTP server and WEB server each running on different ports from a single IP address. Each server will have its own entry in the DNS like ftp.yourdomain. www.highcloud.com.
We can also use CNAME for multiple HTTP servers on the same port with different name on the same physical host.
The major advantage of using CNAME is that if we change the IP address of one A record then any CNAME record pointing to that host will also changed.
Like if we have a website with highcloud.com then this domain name is hooked up to an A-record which translates the domain name to the appropriate IP address 126.96.36.199 . When you have several sub domains, like www.example.com, ftp.example.com, mail.example.com etc. and you want this sub domains to point to your main domain name that is highcloud.com instead of creating A-records for each sub domain and binding it to the IP address of your domain, you create an alias, a CNAME-record for all these as shown in the image below.
Creating, Modifying and Deleting CNAME Records:
Creating, Modifying and Deleting CNAME is a simple process. In order to create a new CNAME follow the step below.
1. Sign into your cPanel-WHM account .
2. Go to ‘DNS Functions’ from the Home and click on ‘Edit DNS Zone’ in your WHM server or click the ‘Advanced Zone Editor’ button in the Domains section or your cPanel account.
3. Choose a Zone to Edit from the left sidebar and click on the ‘Edit’ button next to your domain.
4. Next scroll down to the bottom and you will see an ‘Add New Entries’ Below this Line section.
Here you see the default fields including Name, TTL and then a drop down menu to select which record you would like to add. Click on the Select drop-down menu and choose CNAME. In the first field enter your CNAME entry like we used www, mail, ftp and test. Then Enter the TTL and Hostname in the available field next to CNAME and Click the Save button as shown.
5- After saving your changes, CNAME will be updated within your selected TTL. If you wish to modify or delete your CNAME entries then leave all entries blank and point to ‘Select’ option or choose any other DNS record and click on the Save button.
In this article we have learned about basics of CNAME and its use for web domain.
CNAME records are handled specially in the domain name system, and have several restrictions on their use when a DNS resolver encounters a CNAME record while looking for a regular resource record, it will restart the query using the canonical name instead of the original name.
A CNAME record must always point to another domain name, never to an IP address. If you have find any difficulty while setting u your CNAME record, do not forget to contact us.
We hope you have found this technote useful on what is a CNAME and how to use it.
Thanks for reading and leave your questions below to keep the conversation going.