Skip to content

CNAME record: Definition, Syntax, and Examples

TL;DR:

CNAME (Canonical Name) is a DNS record type that turns one domain into an alias of another. For example, www.example.com (CNAME) → example.com (actual address). The browser follows the chain and retrieves the final A/AAAA records. CNAME cannot be used on the apex (root) domain — only on subdomains.

Check your domain's DNS →

What is a CNAME record

CNAME (Canonical Name) is a DNS record type that turns one domain into an alias of another. For example, www.example.com (CNAME) → example.com (actual address). The browser follows the chain and retrieves the final A/AAAA records. CNAME cannot be used on the apex (root) domain — only on subdomains.

Check CNAME record online

Use the Enterno.io tool — enter a domain, get results in 1-2 seconds. Free, no signup.

Check →

How CNAME Records Work

A CNAME (Canonical Name) record functions as a pointer that directs one domain name to another. When a DNS resolver encounters a CNAME record, it replaces the domain in question with the target domain specified in the CNAME record. This redirection process is essential for managing various services and hosting configurations.

When a user types in a CNAME domain, the DNS lookup process begins. The resolver first checks to see if the CNAME record exists. If it does, the resolver retrieves the target domain's A or AAAA records, which contain the actual IP address of the server hosting the content. This behavior allows for flexible domain management and makes it easier to change hosting providers without altering the original domain name.

For example, if you have a CNAME record set for www.example.com pointing to example.com, the DNS resolver will first look up www.example.com, find the CNAME record, and then lookup example.com to get the corresponding IP address. The browser then connects to that IP address to retrieve the website content.

Common Use Cases for CNAME Records

CNAME records are widely used for various purposes in domain management and web hosting. Here are some common scenarios where CNAME records are beneficial:

  • Subdomain Redirection: CNAME records allow you to create subdomains like blog.example.com that point to different services, such as a blogging platform.
  • Content Delivery Networks (CDNs): If you use a CDN to serve static assets, you can set up a CNAME record to point your subdomain, like cdn.example.com, to the CDN provider's domain.
  • Third-Party Services: Many services, such as email providers or website builders, require you to set up a CNAME record to verify domain ownership or to route traffic appropriately.
  • Load Balancing: CNAME records can be used in conjunction with load balancers to distribute traffic across multiple servers by pointing to the load balancer's domain.

These use cases illustrate how CNAME records can enhance flexibility and efficiency in managing domain names and online services.

Configuring CNAME Records: Practical Examples

Configuring CNAME records is straightforward, and can be done through your DNS provider’s management interface. Here are some practical examples to illustrate various configurations:

  • Basic CNAME Setup: To create a CNAME record for www.example.com that points to example.com, you might enter the following:
  • Host: www
    Type: CNAME
    Value: example.com
  • CNAME for a Subdomain: If you want shop.example.com to point to your e-commerce platform (e.g., store.shopify.com), you would configure it like this:
  • Host: shop
    Type: CNAME
    Value: store.shopify.com
  • CNAME for a CDN: To set up a CNAME that points assets.example.com to a CDN provider, you might use:
  • Host: assets
    Type: CNAME
    Value: cdn.provider.com

After making these configurations, it may take some time for DNS changes to propagate globally. Always verify your CNAME records using tools like dig or nslookup to ensure they resolve correctly.

A / AAAAIPv4 and IPv6 host addresses
MX RecordsDomain mail servers
TXT / SPFVerification & anti-spoofing
NS / SOAName servers & zone authority

Why teams trust us

12
DNS record types
SPF+DKIM
email protection
<1s
DNS response
3
check regions

How it works

1

Enter domain

2

Select record type

3

Get DNS response

What are DNS Records?

DNS (Domain Name System) translates domain names into IP addresses. DNS records are instructions that define where to route traffic, email, and how to verify domainownership.

Complete Lookup

Query all record types — A, AAAA, MX, NS, TXT, CNAME, SOA — in a single request.

Instant Results

Direct queries to authoritative servers. Results in milliseconds, no caching.

Security Checks

SPF, DKIM, and DMARC analysis to evaluate email protection against spoofing and phishing.

Export & History

Save check results. Compare DNS records before and after registrar changes.

Who uses this

DevOps

DNS check after deploy

Email marketers

SPF/DKIM/DMARC audit

SEO

DNS config audit

Sysadmins

DNS zone control

Common Mistakes

Missing SPF recordWithout SPF, emails may land in spam. Add a v=spf1 TXT record.
Single NS serverIf the only NS fails, the domain becomes unreachable. Use at least 2 NS servers.
CNAME conflicting with other recordsCNAME cannot coexist with MX or TXT on the same name — this violates RFC.
TTL set too highWith 86400s TTL, DNS changes take a full day. Lower TTL to 300 before migrations.
Missing PTR recordMail servers check PTR. Without it, emails may be rejected.

Best Practices

Set up SPF + DKIM + DMARCThe trio of records that protects your email from spoofing and improves deliverability.
Use 2+ NS serversDistribute NS servers across different networks for redundancy.
Lower TTL before migrationSet TTL to 300 at least 24-48 hours before an IP change for fast propagation.
Verify DNS after changesAfter updating records, confirm changes propagated correctly and no errors remain.
Add a CAA recordCAA restricts which Certificate Authorities can issue SSL certificates for your domain.

Get more with a free account

DNS check history, API keys and DNS change monitoring.

Sign up free

Learn more

Frequently Asked Questions

How does CNAME record differ from similar concepts?

See the full breakdown in the article above. For a quick check, use our online tool.

Does this need manual updates?

Usually no — most modern services configure it automatically. Manual setup is only needed for migrations or exotic configurations.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.