DNS CNAME Record

A DNS CNAME record, short for Canonical Name record, is a type of DNS entry used to alias one domain name to another. This helps streamline domain management, reduce redundancy, and simplify configuration for subdomains.

What is a DNS CNAME Record?

When an admin creates a CNAME record, they are creating a record that points to another DNS record instead of an IP address (like in the case of an A record, for example). A CNAME will act as an alias. Essentially is an end users is typing in a URL that correlates with a CNAME, a DNS lookup will be performed to find that CNAME and then another lookup will be performed to find the A record which will send back an IP address to enable communication between the end user and the destination.

A CNAME record may point to an A record, but could also point to another CNAME record. In this case, though, even more lookups will be performed which may impact user experience because there will be added latency.

CNAME Record Example

Record

Type

Value

two.menandmice.com

CNAME

one.menandmice.com

one.menandmice.com

A

192.168.100.2

How does a DNS CNAME Record work?

There are a few different use cases for CNAME records. In general, what companies do is rather than creating A records for every subdomain they might have. They’ll create an A record for their root domain, and then create several CNAME records for each of their subdomains. The end user will then be redirected to the root domain if they type in a URL that specifies a sub-domain.

blog.example.com in this case would lead the end user to example.com:

Record

Type

Value

two.menandmice.com

CNAME

example.com

example.com

A

192.168.100.5

An end user in the above example would type in blog.example.com. The Domain Name System would start to look that name up, but see that it’s a CNAME record and restart the query for example.com. This leads them to an IP address, which begins to open the line of communication.

In the case of a CNAME leading to a CNAME, this leads to multiple queries:

Record

Type

Value

blogs.example.com

CNAME

blog.example.com

blog.example.com

CNAME

example.com

example.com

A

192.168.100.5

A better way to do the above example:

Record

Type

Value

blogs.example.com

CNAME

example.com

blog.example.com

CNAME

example.com

example.com

A

192.168.100.5

When to Use a CNAME Record

A DNS CNAME record is ideal in scenarios where you want one domain name to serve as an alias for another. This helps simplify DNS management and avoid redundancy. 

Here are common use cases where a CNAME record is the best choice:

1. Redirecting Subdomains to a Root Domain

If you want multiple subdomains (like blog.example.com, shop.example.com) to point to example.com, you can use CNAME records. This ensures all traffic routes through a single A record, making updates and management easier.

2. Using Third-Party Services

When integrating with platforms like GitHub Pages, Shopify, or WordPress, you might be instructed to create a CNAME record (e.g., pointing store.example.com to shop.myshopify.com). A CNAME record allows this aliasing without manually managing IP addresses.

3. Load Balancers and CDNs

CNAME records are often used to point domain names to a Content Delivery Network (CDN) or load-balanced resource, which typically uses a dynamic endpoint (e.g., cdn.example.net) instead of a static IP.

4. Avoiding Duplicate A Records

When you have multiple subdomains pointing to the same IP, managing separate A records can lead to errors. Using a DNS CNAME record allows centralized control, update one A record, and all aliases follow suit.

5. Creating Development or Staging Environments

You can use a CNAME to create aliases like dev.example.com or staging.example.com that point to your main production domain or a specific server environment.

Pro tip: A DNS CNAME record must always point to another domain name, never directly to an IP address. Additionally, the root domain (also called the apex) cannot use a CNAME record in most DNS providers.

Simplify DNS Management with BlueCat Micetro

Managing DNS CNAME records across complex, hybrid environments can quickly become cumbersome without the right tools. BlueCat Micetro DNS management provides centralized, automated DNS management that helps eliminate manual errors, improve visibility, and scale effortlessly. Whether you’re managing CNAME records, A records, or entire zones, Micetro ensures policy enforcement, orchestration, and seamless integration across your existing infrastructure.