
A Record vs CNAME: Which DNS Record Should You Use?
A records and CNAME records both make a hostname resolve to something usable — but they do it in different ways, they have different limitations, and picking the wrong one for a given hostname causes problems that are entirely avoidable once you know the rule.
The Core Difference
| A Record | CNAME Record | |
|---|---|---|
| Points to | An IP address directly | Another hostname |
| Resolution | Single lookup | Follows the target hostname, then resolves that |
| Usable at domain root? | Yes | No |
| Can coexist with other records at the same name? | Yes | No — must be the only record there |
| Typical use | Root domain, direct server IP | Subdomains, CDNs, third-party services |
An A record is a direct answer: example.com → 192.0.2.10. A CNAME is an instruction to keep looking: www.example.com → example.com, and only then does resolution continue on to find example.com's actual address.
Why You Can't Use a CNAME at the Root Domain
This is the single most common reason people end up choosing between the two. A domain's root — example.com itself, not a subdomain — always has to carry an SOA record and at least two NS records, since every zone requires them. But a CNAME record can't coexist with any other record type at the same name; if a name has a CNAME, that's the only thing allowed there. Put those two requirements together and a literal CNAME at the root is simply invalid — most authoritative nameservers will reject it outright.
That's why root domains almost always use an A (and usually an AAAA) record instead. Providers who want to offer CNAME-like convenience at the apex anyway do it with a workaround — commonly branded CNAME flattening, ALIAS, or ANAME — where the provider's own infrastructure resolves the target hostname on your behalf and publishes a plain A/AAAA record to the rest of the internet.
When to Use an A Record
- At your domain's root/apex, since a CNAME isn't an option there.
- When you're pointing at a specific IP address you control and don't need it to automatically follow another hostname.
- When the hostname needs to carry other records alongside it — a CNAME can't share a name with a TXT record, for instance, but an A record can.
When to Use a CNAME
- For subdomains that should always match another hostname —
wwwpointing at the root domain is the classic case. - When pointing at a CDN, hosting platform, or SaaS provider using the domain name they give you, rather than an IP address that could change without notice on their end.
- Anywhere you'd otherwise have to manually update an IP address every time the target infrastructure changes — the CNAME keeps working automatically as long as the target hostname's own records stay current.
Example Configurations
A record at the apex, CNAME for www:
example.com. A 192.0.2.10
www.example.com. CNAME example.com.
Subdomain pointed at a third-party service:
app.example.com. CNAME customer-123.saas-provider.net.
Decision Table
| Situation | Use |
|---|---|
Root domain (example.com) | A (and AAAA) |
www subdomain | CNAME to the root, or its own A record |
| Subdomain pointed at a CDN/SaaS provider | CNAME |
| Hostname needs a TXT/MX record too | A (CNAME can't share the name) |
| Direct, stable IP you manage yourself | A |
How to Check Which One a Hostname Uses
ProURLMonitor's free DNS Records Checker looks up both A and CNAME records (along with AAAA, MX, TXT, NS, and SOA) for any hostname, so you can confirm exactly which one is configured before making a change. For the full picture on CNAME mechanics and its limitations, see our CNAME record guide.
Frequently Asked Questions
What's the core difference between an A record and a CNAME record?
An A record maps a hostname directly to an IPv4 address. A CNAME record maps a hostname to another hostname, which then gets resolved in turn to find the actual address. An A record is a direct address lookup; a CNAME is one extra hop of indirection.
Can I use a CNAME record instead of an A record for my root domain?
No — a domain's root (apex) is required to carry SOA and NS records, and a CNAME can't coexist with any other record type at the same name, so a literal CNAME at the root is invalid. Root domains use an A (and usually AAAA) record instead, or a provider-specific apex workaround like CNAME flattening, ALIAS, or ANAME.
Is a CNAME record slower than an A record?
Marginally, on an uncached lookup. Resolving a CNAME requires following it to its target hostname and then resolving that hostname's own address record — one extra step compared to an A record, which returns an address directly. Once cached, the difference is negligible for most practical purposes.
When should I use an A record instead of a CNAME?
Use an A record at your domain's root, and anywhere you're pointing directly at a specific, stable IP address you control. A records are also the only option when a hostname needs to carry other record types alongside it, since CNAME can't share a name with anything else.
When should I use a CNAME instead of an A record?
Use a CNAME for subdomains that should always match wherever another hostname points — most commonly www pointing at the root domain, or a subdomain pointed at a CDN, hosting platform, or SaaS provider's own domain, so you're not stuck manually updating an IP address every time that provider's infrastructure changes.
Does changing from an A record to a CNAME (or back) affect anything else?
It can. Because a CNAME can't coexist with other records at the same name, switching a hostname to a CNAME means removing anything else configured there, such as a TXT record used for verification. Check what else lives at a hostname before switching its record type.
Try Our Free SEO Tools
Put what you learned into action with our free SEO analysis tools.