What Is a CNAME Record?

A CNAME record aliases one domain name to another. Learn when to use CNAME vs A records, the root-domain limitation, and how ALIAS records solve it.

Last updated July 11, 2026

A CNAME record (Canonical Name record) makes one domain name an alias of another. Instead of pointing at an IP address like an A record, a CNAME says "the answer for this name is whatever that other name resolves to." Example: www.example.com → CNAME → example.com.

CNAME vs A record: which one should I use?

A recordCNAME record
Points toAn IPv4 addressAnother hostname
Use whenYou control a stable IPThe target's IP may change (SaaS, CDN, PaaS)
Allowed at root domainYesNo (use ALIAS)
Extra lookup costNoneOne extra resolution step

Rule of thumb: your own servers → A record; someone else's platform → CNAME. When you point shop.example.com at a hosted storefront via CNAME, the platform can change its IPs freely and your DNS keeps working.

Why can't I put a CNAME on my root domain?

The DNS standard says a name with a CNAME may have no other records - but every zone apex must carry SOA and NS records. So example.com itself cannot be a CNAME. The practical fix is an ALIAS (ANAME) record: it behaves like a CNAME but is resolved server-side and returned as A/AAAA answers, which is standards-compliant at the apex. ice.domains free DNS hosting supports ALIAS records on every zone at no cost.

Does a CNAME redirect visitors?

No - this is the most common misconception. A CNAME operates purely at the DNS layer: resolvers follow it silently and the browser's address bar never changes. If you want old-site.com to visibly send users to new-site.com, you need an HTTP 301 redirect from a web server, not a CNAME.

CNAME best practices

  • Avoid chains. CNAME → CNAME → A works but adds latency and failure points. Point directly at the final name.
  • Don't mix records. A name with a CNAME cannot also have MX, TXT, or other records - put those on the target name or use a different host.
  • Mind email. Never CNAME a name that receives mail; MX records must live on a CNAME-free name.
  • TTL applies per hop. Propagation of a CNAME change is governed by the CNAME's own TTL, not the target's.

Frequently Asked Questions

No. The DNS standard forbids a CNAME at the zone apex (example.com) because it conflicts with the required SOA and NS records. Use an ALIAS/ANAME record instead, which ice.domains supports for free.

No. A CNAME is invisible to users - it only tells resolvers to look up another name. The URL in the browser does not change. For visible redirects, use an HTTP 301/302 redirect.

Technically yes, chains resolve - but each hop adds latency and fragility. Keep chains to one level and point the final CNAME at a name with A/AAAA records.

Get free DNS hosting in minutes

Unlimited zones and records on a global anycast network. Works with domains registered anywhere. No credit card required.