What is a CNAME record in DNS?

Back to blog overview
Posted on 2025-08-19 (last update was on 2025-08-19)

When you need one domain to answer for another, CNAME records make it happen. They're the DNS redirects that keep your subdomains organized, your third-party services connected, and your infrastructure flexible – all without juggling IP addresses.

 

What is a CNAME record

A CNAME (or, canonical name) record is an alias that points one domain name to another domain name, rather than directly to an IP address. Instead of duplicating IP addresses across multiple DNS records, you create a CNAME that references the canonical (true) name of your domain. This makes DNS management significantly simpler when IP addresses change.

 

The crucial difference between CNAME and A records lies in their targets. While A records point directly to IP addresses like 192.0.2.1, CNAME records point to other domain names. In our example, www.dnsense.io might have a CNAME record pointing to dnsense.io (yes, they are different) - which then has an A record with the actual IP address.

Screenshot of CNAME records of DNSense

 

Why use aliases instead of hardcoding IP addresses everywhere? When your server's IP changes, you only need to update one A record instead of dozens. All CNAME records pointing to that domain automatically inherit the new IP address through DNS resolution.

 

The term "canonical name" refers to the authoritative or primary domain name. Every CNAME record must ultimately resolve to an A (IPv4) or AAAA (IPv6) record – it's essentially telling DNS "the real answer is over there."

 

How CNAME records work

CNAME records trigger a two-step DNS resolution process. First, the DNS resolver finds the CNAME record and notes the target domain. Then, it performs another lookup for that target domain's A record. For example, when resolving blog.example.com → example.com → 192.0.2.1, the resolver makes two separate queries.

 

A critical DNS rule: CNAME records can't coexist with other records for the same hostname. Let’s say if blog.example.com has a CNAME record, it cannot have A, MX, or TXT records. This restriction exists because the CNAME essentially means "get all information from this other domain."

 

Root domains (@) cannot have CNAME records because they must have SOA and NS records for DNS to function. This is why you'll never see a CNAME record for your-domain.com itself, only for subdomains like www.your-domain.com.

 

TTL values get inherited through the resolution chain. The effective cache time becomes the lowest TTL encountered during resolution. Long CNAME chains impact performance since each hop requires an additional DNS query.

 

Typical CNAME record configurations

The most standard CNAME configuration points the www subdomain to the root domain. This ensures visitors reach your site whether they type www.example.com or example.com, without maintaining duplicate A records.

 

Third-party service integration heavily relies on CNAME records. When you connect external services, they provide their domain names for your CNAME records. Typical business configurations include:

 

  • www → your-domain.com (website alias)
  • mail → mailgun.org (email service)
  • support → your-domain.zendesk.com (helpdesk)

 

CDN setups use CNAME records to route traffic through content delivery networks. Your cdn.example.com might point to a provider-specific domain that handles geographic distribution and caching.

 

Multi-domain setups benefit from CNAME records when several domains should display the same website. Instead of maintaining separate hosting for each domain, you point them all to your primary domain using CNAME records.

 

Important: Never attempt to create CNAME records for root domains. This violates DNS specifications and you will break your website.

 

Need help managing your DNS?

Managing CNAME records becomes complex when you're handling dozens of domains across different registrars. Each provider has its own interface, update times, and quirks.

 

If you're coordinating DNS changes across multiple providers or need better control over your domain infrastructure, we can help streamline your DNS management.

 

Questions about CNAME records or DNS management? Contact our team – we help businesses simplify their domain operations every day