Key takeaways
- An A record maps a hostname directly to an IPv4 address (AAAA for IPv6).
- A CNAME makes a hostname an alias of another hostname.
- The root domain can't be a standard CNAME, so it normally uses A/AAAA records.
Both records tell resolvers where a name should lead — they just do it differently.
The difference
| A record | CNAME record | |
|---|---|---|
| Points to | An IPv4 address (203.0.113.10) | Another hostname (shop.provider.net) |
| Can be used at the root domain | Yes | No (standard DNS) |
| Can coexist with other records at the same name | Yes | No |
| Updates when the target’s IP changes | You update it | Automatic — follows the target |
When to use an A record
Use A (and AAAA for IPv6) records when you know the server’s IP address and control it — for example the root domain pointing to your hosting server.
When to use a CNAME
Use a CNAME when a service gives you a hostname rather than an IP, or when one name should always follow another:
www.example.com→example.comshop.example.com→ a hosted store platform- verification and mail-service records that providers ask you to create as CNAMEs
The root-domain rule
Standard DNS doesn’t allow a CNAME at the zone apex (example.com) because the apex must hold other records like SOA, NS and MX. That’s why root domains normally use A/AAAA records.
Check what a name currently uses with the DNS lookup or CNAME lookup.
Frequently asked questions
Is a CNAME slower than an A record?
A CNAME can require an extra lookup to resolve the target, but resolvers cache both, so the difference is rarely noticeable.
What is CNAME flattening or an ALIAS record?
Some DNS providers resolve the target behind the scenes and answer with A/AAAA records, letting you point the root domain at a hostname.