CNAME is the abbreviation for Canonical Name as against the popular thinking that it means a Custom Domain Name.
A CNAME in a way is an alias created as a record in the Domain Name System (DNS) that helps to differentiate services running on the same domain name via these alias records.
For example, the following are some of the common CNAMEs that you will see with most websites.
Difference between a CNAME and a Sub-domain
Although, they look same, there is a lot of difference between a CNAME record and a sub-domain. Subdomains are just folder level grouping of the same domain name.
CNAMEs could be serving common services (e.g. ftp, smtp,…) residing on the same domain name or point to other domains while referring to an alias. E.g. mail.MyWebsite.com is probably serving the mail features rendered from another server. Or cdn.MyWebsite.com may be serving resources from an external Content Delivery Network (CDN).
Also please note that, referring to CNAMEs in your web browser requires another DNS lookup while sub-domains always remain on the same IP.
CNAME vs an A Record
Technically speaking a CNAME always refers to a domain name. An A record on the other hand points and resolves to an IP address. Resolving CNAMEs involve a look up and hence it may be slightly costlier to resolve CNAMEs.
Creating a CNAME in cPanel
You can create a CNAME record after logging into your HostGator cPanel.
Go to the cPanel Domains section and click the Simple DNS Zone Editor icon to create a CNAME.
In the next page, just select the domain name (e.g. YourDomainName.com), enter your CNAME (e.g. cdn) and enter the Record (e.g. hostgatorlogin.netdna.com). There may be several A records and CNAMEs already existing in your account.
Note: You can also use the Advanced DNS Zone Editor in your cPanel to enter CNAME records. This gives you the possibility to specify the TTL (Time To Live) value for your CNAMEs which decides when – in seconds – the CNAME record validity expires in the DNS lookup database
Search Tags: How to create cname in cpanel, cname record example, cname vs a record, cname and subdomain, ttl cname records