How and When to Use CNAME Records

How and When to Use CNAME Records

How and When to Use CNAME Records

A CNAME record stands for Canonical Name. This record specifies merely an alias or nickname of a primary host. For instance, if you have a domain name like example.com, but you want users to access it using its ‘www’ part  (www.example.com), you can create a CNAME record pointing to the example.com site.

In simple terms, a canonical name is a name that a host is known by, but it is not its real name. It is merely used to associate an alias/extra domain name with a canonical domain name.
You can set your CNAME records on the DNS management interface or sometimes DNS Zone Editor. In this guide, we are going to discuss how and when to use CNAME records.

So When Should You Use a CNAME Record

To associate your server’s IP address with your domain name, you must create an A record to map your domain name to the IP address.

Sometimes, you might need more than one domain name to resolve to the same IP address, and this is where CNAME comes in. This is especially very useful during a transition period. Instead of pointing to an IP address, A CNAME record points to another domain name.

You can use a CNAME record in the following two scenarios.

1.
Redirecting Multiple Domains to a Single IP Address

For instance, if you are migrating from example.com to example.org, you can use a CNAME record to redirect visitors to the new domain name.

2.
Pointing Several Sub-domains to the Main Domain Name

Apart from your main website, you might have different services running on your domain name through sub-domain addresses. Instead of creating an A record for all these services that point to your IP address, you should create CNAME records for all of them.

This approach has one advantage. If you later change the IP address of your server, you will only have to change one A record and all the CNAMEs will follow the new IP address.
For instance, the below DNS records are associated with the domain name ‘example.com’

Special Notes About CNAME Records

  • CNAME records cause multiple requests to be sent to the DNS servers and hence, there can be a few milliseconds delay if you are visiting an alias of a primary domain name.
  • Your main domain name should always point to an A record and never point to a CNAME

Conclusion

In this guide, we have defined a CNAME record and where it is applied in the World Wide Web communication. If you were getting some trouble with these DNS terms, you should now be in a position to apply them on your DNS manager without any problems.

 

Check out these top 3 Domain hosting services:

Ultahost
£2.35 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
HostArmada
£2.02 /mo
Starting price
Visit HostArmada
Rating based on expert review
  • User Friendly
    4.5
  • Support
    4.5
  • Features
    4.5
  • Reliability
    4.5
  • Pricing
    4.0
Hostinger
£2.42 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7

How to Use DNS tools for Web Hosting

Regardless of what kind of web hosting you have, you likely have a website, and
7 min read
Lindsey Conger
Lindsey Conger
Author

How to Create a Subdomain Using cPanel

This tutorial shows you how to create a sub-domain using the cPanel web hosting
3 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Add Additional Domain Names to your Hosting Account using cPanel

This article provides you with step-by-step instructions for adding additional d
3 min read
Avi Ilinsky
Avi Ilinsky
Hosting Expert

How to Change the Domain Name of Your WordPress Site

Use our amazing step-by-step guide to completely change the domain name of your
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top