Blog

CNAME Records Explained

While DNS records can seem complicated, they’re quite simple once you learn what each one is for. In this resource, you’ll learn the purpose and limitations of the CNAME record type. 

What is a CNAME Record?

CNAME is short for Canonical Name. This DNS record is used as an alias for another domain name. The purpose of a CNAME is to point a fully qualified domain name (FQDN) or subdomain to another FQDN, subdomain, or to a root domain. When a CNAME record is queried, an additional lookup is generated to search for the A (or AAAA) record that has the IP  address for the domain. Once the IP address is identified, the domain will determine where to send the request depending on the CNAME record (ie blog, about, contact, services page, etc.). For instance, a query for social.dnsmadeeasy.com will prompt a DNS lookup for dnsmadeeasy.com. But the page the end user is sent to is still the page “social” maps to.

CNAME Record Example

To help visualize how a CNAME works, try thinking of it in terms of a building with multiple offices. Let’s say you have a meeting at DNS Made Easy’s office in Reston, VA, but before the meeting, you need to drop off a document to Margaret in HR, bring Jesse in Sales a coffee, and bring Lorena in Support a tea before meeting with the boss, Steven Job. 

In this case, the DNS Made Easy office building is the root domain or location you need to be (the IP address). Margaret in HR, Jesse in Sales, Lorena in Support, and Steven Job’s offices are subdomains. They are all in the same building (domain) but have different locations within the building. To get to any of these offices (subdomains), you still need to know the address (IP) of the building (domain) the individual offices are located in.

If DNS Made Easy changes its IP address (office building location), the offices (subdomains with CNAME records) would automatically change/move to the new location.

Now let’s take a look at how the example above would look in a URL:

Domain Name Structure

A complete domain name has a three parts. It starts with the subdomain or host name (in this case is “www” to indicate “world wide web”), next it's followed by the name of the domain name (in this case "dnsmadeeasy", and finally the TLD (in this case .com ).

Domain Name Structure

Now let’s take a look at how the example above would look in a URL:

Root domain:

dnsmadeeasy.com

Subdomain Examples:

www.dnsmadeeasy.com

hr.dnsmadeeasy.com 

sales.dnsmadeeasy.com 

support.dnsmadeeasy.com 

boss.dnsmadeeasy.com 

What are the Advantages of Using CNAME Records

The main advantage to using CNAME records is that you don’t have to create A records for every subdomain. Instead, you can have multiple CNAMEs pointing to hosts, but that ultimately resolves to the IP address in the domain’s A record. This way, any domain or subdomain using a CNAME record that maps to a domain with an A record will automatically update if the A record is changed.

CNAME Record Limitations and Restrictions

There are some important things to remember when it comes to CNAME records. For one, CNAMEs can never point directly to an IP address. Instead, it must point to another domain name. 

Another limitation is that CNAME records must be uniquely named and can’t share the name of another record. It’s also worth noting that while a CNAME record can map to another CNAME record, this practice is discouraged as it results in unnecessary DNS lookups due to negative effects on performance.

Did you know?: Our ANAME record technology allows you to bypass the limitations of a CNAME, as it functions like a CNAME record but can be used at the root of the domain.

A Record vs CNAME

The difference between A and CNAME records is that an A record is used to point directly to the root of a domain or an IP address. A CNAME, on the other hand, is only used as an alias to point one hostname to another. 

CNAME Record Lookup

To view the CNAME records for your domain or to troubleshoot DNS issues related to a CNAME record, you can perform a record lookup for the subdomain of your root domain. Doing this will provide a list of any CNAME records for the queried domain. 

Here are a few free tools that can perform various record lookups:

Bypass CNAME Restrictions

The important thing to remember about CNAME records is that they are used to alias another domain or subdomain and can’t directly point to an IP address. If you are looking for a way to bypass CNAME restrictions, visit our What is an ANAME Record resource.

Heather Oliver
Heather Oliver is a Technical Writer for Constellix and DNS Made Easy, subsidiaries of Tiggee LLC. She’s fascinated by technology and loves adding a little spark to complex topics. Want to connect? Find her on LinkedIn.

Our latest news

Stay up to date on the latest DNS Made Easy resources and news

Want a Proof of Concept?

Start Free Trial