Explainers · Explainer
What Is a CNAME Record? A Plain Explanation

Short answer
A CNAME record maps one domain name to another domain name, so the first name works as an alias for the second. When a resolver looks up the alias, it follows the CNAME to the target name and then reads that name's address records. You cannot point a CNAME at an IP address, and you cannot place one at the root of a domain.
Key takeaways
- A CNAME record points one domain name at another domain name, never at an IP address.
- A CNAME cannot share its name with any other record, which is why it cannot sit at the root of a domain.
- If the target's IP address changes, every alias that points to it follows the change with no edit of its own.
- CNAME chains add extra DNS lookups, so point each alias straight at the canonical name.
- How fast a CNAME change spreads depends on the record's TTL, which vendors often set at 300 seconds.
What is a CNAME record?
A CNAME record maps one domain name to another domain name, so the first name works as an alias for the second.
CNAME stands for canonical name. Cloudflare's CNAME guide explains that you use a CNAME record in place of an A record when a domain or subdomain is an alias of another domain. The target name is the canonical name, and the alias borrows its address records.
The concept comes from the first DNS standards. RFC 1034, published in November 1987, set out the CNAME record as the way to mark one name as an alias of another. That rule has stayed in place for almost 40 years, as of November 2026.
How does a CNAME record work?
When a resolver looks up an alias, it follows the CNAME to the target name and then looks up that name's address.
Say blog.example.com has a CNAME pointing to example.com. A visitor's resolver first asks for blog.example.com, receives the CNAME, and then asks for example.com to get its A record and IP address. The extra step is small, but it is real.
This design has one clear benefit. If the target's IP address changes, only the target's A record needs an update. Every alias that points to it follows the change with no edit of its own.
How is a CNAME record different from an A record?
An A record maps a name to an IPv4 address, while a CNAME record maps a name to another name.
Google Cloud's DNS records overview puts it plainly: an A record maps host names to their IPv4 address, and a CNAME record is the DNS alias for an A record. A CNAME never holds an address itself.
Use an A record when you know the address, and use a CNAME when you want a name to follow another name. The table below sums up the split.
| Record | Points to | Holds an IP address? | Best for |
|---|---|---|---|
| A | IPv4 address | Yes | Root domain, fixed addresses |
| AAAA | IPv6 address | Yes | IPv6 addresses |
| CNAME | Another domain name | No | Subdomains, aliases, hosted services |
| Alias | Target chosen by the provider | Acts like an A record | Root domain pointing at a service |
Can a CNAME record point to an IP address?
No, a CNAME record must always point to another domain name, never to an IP address.
Cloudflare states this as a hard rule: all CNAME records must point to a domain, never to an IP address. DNSimple's CNAME reference, last updated on 26 October 2026, says the same and points to RFC 1035 for the record format.
If you need a name to resolve to an address, use an A record for IPv4 or an AAAA record for IPv6. If the target is a hosted service with a changing address, point the CNAME at the hostname the service gives you.
Why can a CNAME record not sit at the root of a domain?
A CNAME cannot sit at the root because the root must also hold SOA and NS records, and a CNAME cannot share its name with any other record.
Google Cloud's DNS docs explain that you cannot place a CNAME at the apex because it cannot exist beside the SOA record the apex needs. AWS Route 53 guidance gives the same answer: you cannot create a CNAME record for example.com itself.
Some providers offer a fix. Route 53 Alias records can sit at the root, and Google Cloud DNS offers ALIAS records that act like a CNAME but can only be used at the zone apex.
Cloudflare's CNAME flattening docs, updated on 24 June 2026, also let you use a CNAME at the apex by returning the final IP address instead of the CNAME record. These are provider features, not standard CNAME records.
Can a CNAME record share its name with other records?
No, a CNAME record cannot share its name with any other record, including A, MX, TXT, and SOA records.
RFC 1034 states that if a CNAME record is present at a node, no other data should be present there.
RFC 1912, published in February 1996, repeats the rule with a plain example: if one name is an alias for another, you cannot also give it an MX record, an A record, or even a TXT record.
The rule also limits what MX and NS records can point to. Cloudflare notes that MX and NS records cannot point to a CNAME record; they must point to an A record for IPv4 or an AAAA record for IPv6.
RFC 1912 cites RFC 974, which states that MX records must not point to an alias defined by a CNAME.
What are CNAME records used for?
CNAME records are used for subdomains, hosted services, and domain checks, anywhere one name should follow another.
Common uses include:
wwwandblogsubdomains that point at the root domain, so only the root A record needs care when the IP changes.- A custom domain for a web app, such as a
wwwCNAME pointing to a host likecontoso.azurewebsites.net, as shown in Microsoft Learn's Azure DNS tutorial. - A CDN or hosting hostname, such as a CNAME to a CloudFront hostname like
d123example.cloudfront.net. - Domain checks for Google services, where a CNAME points to
ghs.googlehosted.comwith a TTL of 3,600 seconds, as shown in Google Workspace Help. - Short, stable service names, such as
ftpormail, that point at the real server name.
RFC 1912 even encourages CNAMEs for general service names and warns you to delete them when the host they point to is removed, so stale aliases do not linger.
What is CNAME chaining, and why should you avoid it?
CNAME chaining means one CNAME points to another CNAME, which adds extra lookups and slows each query.
A chain looks like this: blog.example.com points to www.example.com, which points to example.com, which holds the A record. Each hop is one more DNS lookup.
Cloudflare says chaining is possible but inefficient and should be avoided where you can. Point each alias straight at the canonical name instead.
RFC 1912 adds that chained CNAMEs can trip up some resolvers that fail to check for loops, so some hosts may fail to resolve such names. No vendor in the pages opened for this guide states a maximum chain length, so this guide gives none.
How long does a CNAME change take to work?
A CNAME change takes effect once the old record's TTL runs out, so the wait depends on the TTL you set.
TTL stands for “time to live”, and it sets how long resolvers cache a record. Cloudflare's TTL docs, updated on 16 April 2026, explain that longer TTLs speed up lookups but make updates take longer to reach users.
Typical TTL values from vendor docs include:
- Cloudflare: 300 seconds for proxied records (Auto), and 60 seconds to 1 day for DNS-only records on non-Enterprise plans.
- Google Workspace CNAME values: 3,600 seconds.
- Microsoft Learn's Azure tutorial: 600 seconds.
- AWS Route 53 worked examples: 300 seconds.
Lower the TTL before a planned change if you want the switch to spread fast. Our guide to how long DNS propagation takes covers the same timing in more depth.
How do you check a CNAME record?
Run dig www.example.com CNAME in a terminal, or use an online DNS lookup tool to see the record.
The BIND 9 manual describes dig as a flexible tool for asking DNS name servers questions, and most DNS admins use it to fix DNS problems. Add a resolver such as @8.8.8.8 or @1.1.1.1 to ask a specific server.
On Windows, nslookup does the same job. Microsoft Learn's Azure tutorial checks records with nslookup and shows the alias chain it returns. If the answer shows the wrong target, the record at your DNS host is wrong, not the site itself.
What mistakes should you avoid?
The most common CNAME mistakes are pointing at an IP address, placing one at the root, and sharing its name with other records.
Check this list before you save a record:
- Never point a CNAME at an IP address; use an A or AAAA record instead.
- Never put a CNAME at the root of the domain; use an Alias record or CNAME flattening if your provider offers it.
- Never add an MX or TXT record with the same name as a CNAME.
- Keep labels short: Cloudflare's DNS docs cap a DNS label at 63 characters and a full domain name at 253 characters.
- Delete stale CNAMEs when the host they point to is gone.
If your site stops loading after a DNS change, our guide to fixing DNS probe errors walks through the checks.
For WordPress hosting, see how to point a domain to WordPress hosting.
Cloudflare users can also read how to set up Cloudflare for WordPress.
Frequently asked questions
Can I use a CNAME record for my root domain?
No. The root must hold SOA and NS records, and a CNAME cannot share its name with any other record. Use an A record for the root, or an Alias record or CNAME flattening if your DNS provider offers one. Cloudflare, Route 53, and Google Cloud DNS each offer such an option.
What is the difference between a CNAME record and an A record?
An A record maps a name to an IPv4 address, while a CNAME record maps a name to another domain name. A CNAME holds no address itself, so the resolver must look up the target name to get the address. Use an A record when you know the address and a CNAME when you want a name to follow another name.
How long does it take for a CNAME change to take effect?
It depends on the TTL of the old record. With a 300 second TTL, most resolvers pick up the change within minutes, while a TTL of one day can take a full day. Lower the TTL before a planned change if you want the switch to spread fast.
Can a CNAME record point to another CNAME record?
Yes, this is called CNAME chaining, and DNS will follow the chain. It is best to avoid it because each hop adds another lookup and slows the query. Some resolvers also fail to check chains for loops, so point each alias straight at the canonical name.
Why does my CNAME record not work?
Common causes are pointing the CNAME at an IP address, placing it at the root, or giving the same name to another record such as an MX or TXT record. Check the record with dig or nslookup, confirm the target name is spelled right, and wait for the old TTL to run out.
Sources
- What is a DNS CNAME record? Cloudflare
- RFC 1034: Domain names - concepts and facilities IETF
- RFC 1912: Common DNS Operational and Configuration Errors IETF
- DNS records overview Google Cloud
- Route 53 Alias vs CNAME: Which DNS Record Should You Use? AWS Builder
- CNAME flattening Cloudflare
Is your product missing, or something out of date?
Tell us what to add or correct. We read every note and reply when we need a source. A message does not buy a ranking.
Thanks — we review requests within 3 business days.
Related guides
About the editors
Researched from the primary sources listed above and checked against our editorial rules before publishing.


