DNS & Domain Guides

CNAME vs ALIAS: When to Use Each Record Type

Learn the difference between CNAME and ALIAS records, when to use each one, and why root domains usually need special handling.

By CheckDomainHealth Editorial Team Reviewed by Dionis Ceban Updated Jun 28, 2026 8 min read Beginner

Introduction

CNAME and ALIAS records both help point a hostname to another destination, but they are not the same. A CNAME points one hostname to another hostname, while ALIAS or ANAME records are provider-specific records that let some DNS providers support hostname-style pointing at the root domain.

This matters when connecting a domain to a SaaS platform, CDN, hosting provider or website builder. Using the wrong record type can cause DNS conflicts, break the root domain, or prevent email and verification records from working correctly.

Quick answer

Quick answer

A CNAME record points one hostname to another hostname, such as www.example.com to example.com. A normal CNAME usually cannot be used at the root domain because it conflicts with required records like MX, TXT and NS. ALIAS or ANAME records are DNS-provider features that can point the root domain to another hostname while still allowing other records to exist.

What is a CNAME record?

A CNAME record, or Canonical Name record, points one hostname to another hostname.

Example
www.example.com  example.com

In this example, DNS for www.example.com follows the target hostname example.com. CNAME records are commonly used for www, CDN hostnames, SaaS platforms and subdomains.

A CNAME should point to a hostname, not directly to an IP address.

What is an ALIAS or ANAME record?

ALIAS and ANAME records are DNS-provider-specific record types that behave somewhat like CNAME records but are designed to work at the root domain.

Example
example.com  target.hostingprovider.com

The DNS provider resolves the target hostname and returns the appropriate IP addresses to users. This allows the root domain to point to a dynamic hostname while still keeping other records such as MX, TXT and NS.

ALIAS and ANAME are not identical everywhere. The exact behavior depends on the DNS provider.

CNAME vs ALIAS comparison

CNAME

  • Points a hostname to another hostname
  • Usually used for subdomains
  • Usually not allowed at the root domain
  • Standard DNS record type

www.example.com → example.com

ALIAS / ANAME

  • Points a hostname to another hostname-like target
  • Can often be used at the root domain
  • Provider-specific behavior
  • Useful for SaaS, CDN and hosting platforms

example.com → hostingprovider.example.net

Use CNAME for subdomains. Use ALIAS/ANAME only when your DNS provider supports it and you need the root domain to point to another hostname.

Why CNAME is usually not used at the root domain

The root domain, such as example.com, usually needs multiple DNS records at the same name. It may need NS, SOA, MX, TXT, CAA and other records.

A normal CNAME record says that the hostname is an alias of another hostname. Because of that, it usually cannot coexist with other record types at the same name.

If example.com had a normal CNAME, it could conflict with records needed for:

  • email routing through MX
  • email authentication through TXT
  • domain verification
  • SSL issuance through CAA
  • zone authority through NS and SOA

This is why many DNS providers block CNAME records at the root domain.

Common use cases

www hostname

Use CNAME when www.example.com should point to example.com or to a hosting/CDN hostname.

SaaS platform

Use CNAME when a service asks you to point app.example.com, shop.example.com or docs.example.com to their hostname.

CDN or proxy service

Use CNAME for subdomains that should route through a CDN or proxy provider.

Root domain with dynamic target

Use ALIAS/ANAME when example.com must point to a provider hostname instead of a fixed IP.

Website builder or managed hosting

Some platforms require CNAME for www and ALIAS/ANAME or A records for the root domain.

Why this matters

Why this matters

Choosing the wrong record type can break website routing, domain verification or email-related records. A CNAME used incorrectly at the root domain can conflict with MX, TXT, NS or CAA records. An unsupported ALIAS record may also fail if your DNS provider does not offer that feature.

How to check CNAME and ALIAS records

Use DNS Lookup to check whether a hostname returns a CNAME, A, AAAA or other record.

What to compare

When checking CNAME or ALIAS-style setup, compare these five values.

Hostname

The exact hostname being checked, such as www.example.com or app.example.com.

Current DNS answer

Whether DNS returns a CNAME, A, AAAA or another record.

Expected provider target

The hostname or IP value required by your hosting, SaaS or CDN provider.

Root vs subdomain

Whether the record is for example.com or for a subdomain like www.example.com.

Active nameserver

The DNS provider currently controlling the live DNS zone.

If your provider asks for a CNAME at the root domain, check whether your DNS provider supports ALIAS, ANAME or CNAME flattening.

Check CNAME records now

Use DNS Lookup to inspect CNAME, A and AAAA records for your domain or subdomain.

Run DNS Lookup →

Common CNAME and ALIAS problems

CNAME used at the root domain

High

A normal CNAME at the root domain can conflict with required records such as MX, TXT, NS and SOA.

Next step: Use A/AAAA records or an ALIAS/ANAME/CNAME flattening feature if supported by your DNS provider.

CNAME points to the wrong target

High

The hostname points to an old SaaS, CDN or hosting target.

Next step: Compare the current CNAME with the value from your provider.

CNAME target does not resolve

High

The CNAME points to a hostname that no longer exists or does not return usable records.

Next step: Replace the target with the correct provider hostname.

CNAME conflicts with another record

Medium

A hostname with a CNAME usually should not have other record types at the same name.

Next step: Remove conflicting records or use the record type recommended by your provider.

www works but root domain does not

Medium

The www hostname may use CNAME correctly, but the root domain may be missing A/AAAA or ALIAS/ANAME configuration.

Next step: Check both example.com and www.example.com.

Root domain works but www does not

Medium

The root domain may point correctly while www is missing or pointing to an old target.

Next step: Add or update the www CNAME or A record.

ALIAS/ANAME not supported by DNS provider

Medium

Not every DNS provider supports ALIAS, ANAME or CNAME flattening.

Next step: Use provider-supported A/AAAA records, change DNS provider, or follow the platform’s alternative setup.

CNAME chain is too long

Low

Multiple chained CNAMEs can slow troubleshooting and may cause failures if one target breaks.

Next step: Simplify the CNAME chain where possible.

How to configure or fix records

  1. Identify whether you are configuring root or subdomain

    Check whether the record is for the root domain, such as example.com, or for a subdomain, such as www.example.com or app.example.com.

  2. Read the provider instructions

    Use the exact target hostname or IP values from your hosting, CDN, SaaS or website platform.

  3. Use CNAME for subdomains when instructed

    For subdomains such as www, app, shop or docs, use CNAME if your provider gives a hostname target.

    Type: CNAME
    Host: www
    Value: target.hostingprovider.com
  4. Use A/AAAA or ALIAS/ANAME for the root domain

    If the root domain needs to point to a provider, use A/AAAA records if fixed IPs are provided. Use ALIAS, ANAME or CNAME flattening only if your DNS provider supports it.

  5. Remove conflicting records

    A hostname using CNAME should usually not have A, AAAA, MX or TXT records at the same exact name unless your provider explicitly supports a special setup.

  6. Verify DNS resolution

    After saving changes, use DNS Lookup to confirm that the hostname resolves to the intended target.

  7. Check website and SSL

    After DNS resolves correctly, confirm that the website loads and the SSL certificate matches the hostname.

CNAME and ALIAS examples

CNAME examples
www.example.com.   300   IN   CNAME   example.com.
app.example.com.   300   IN   CNAME   app.hostingprovider.example.
Root domain with A record
example.com.       300   IN   A       192.0.2.10
Root domain with ALIAS/ANAME
example.com.       300   IN   ALIAS   target.hostingprovider.example.
Check commands
dig www.example.com CNAME
dig example.com A
dig example.com AAAA

These are examples only. Replace hostnames and values with the exact records required by your provider. ALIAS and ANAME syntax depends on the DNS provider.

What is CNAME flattening?

CNAME flattening is a DNS provider feature that lets the root domain point to another hostname while returning A or AAAA records to resolvers. It is often used when a platform gives a hostname target but the root domain cannot use a normal CNAME.

CNAME flattening behavior depends on the DNS provider. Some providers call similar features ALIAS or ANAME.

CNAME, ALIAS and SSL certificates

CNAME and ALIAS records affect which platform receives traffic for a hostname. The destination platform must be configured to serve the correct website and SSL certificate for that hostname.

If DNS points to the correct target but SSL still fails, check whether the domain was added to the hosting/CDN platform, whether SSL was issued for both root and www, whether CAA records allow the certificate authority, and whether redirects between root and www are configured correctly.

CNAME and email records

CNAME records are not usually used to route incoming email for the root domain. Email routing depends mainly on MX records, and email authentication depends on TXT records such as SPF, DKIM and DMARC.

Do not add a CNAME at the root domain if it would remove or conflict with MX or TXT records needed for email.

Frequently asked questions

Can I use a CNAME at the root domain?

Usually no. A normal CNAME at the root domain can conflict with required records such as NS, SOA, MX and TXT. Some DNS providers offer ALIAS, ANAME or CNAME flattening for this use case.

What is the difference between CNAME and ALIAS?

A CNAME is a standard DNS record that points one hostname to another hostname. ALIAS is a provider-specific feature that can often be used at the root domain.

Should www be a CNAME?

Often yes. Many setups use www as a CNAME pointing to the root domain, CDN or hosting provider hostname.

Is ALIAS supported by every DNS provider?

No. ALIAS, ANAME and CNAME flattening are provider-specific features. Check your DNS provider’s documentation.

Can a CNAME point to an IP address?

No. A CNAME should point to a hostname. Use an A record for IPv4 addresses and an AAAA record for IPv6 addresses.

Why does my CNAME not work?

Common causes include using the wrong hostname, editing DNS at the wrong provider, conflicting records, a target that does not resolve, or missing configuration at the destination platform.

Does CNAME affect email?

It can if used incorrectly at the root domain or if it conflicts with required mail-related records. Email itself is usually controlled by MX, SPF, DKIM and DMARC records.

What should I use for the root domain?

Use A/AAAA records if your provider gives IP addresses. Use ALIAS, ANAME or CNAME flattening only if your DNS provider supports it and your platform recommends it.

Use these free tools to verify your configuration after applying changes.

Browse all DNS & Domain guides →

Need help applying this fix?

Send us your domain, report link or issue details. CheckDomainHealth will review the request and route it to the right technical team if hands-on support is needed.

Get Help Run Domain Health Check

Was this guide helpful?

Your feedback helps us improve our guides for everyone.