A record vs CNAME: when to use each
Two of the most common DNS records do similar-looking jobs, and mixing them up is behind a lot of "my domain won't point where I want" confusion. The distinction is simple once you see what each actually returns.
What each one does
- An A record maps a name directly to an IP address:
app.example.com → 192.0.2.10. (Its IPv6 sibling is the AAAA record.) The answer is a literal address. - A CNAME maps a name to another name:
www.example.com → example.com. It is an alias. The resolver then has to look up the target's records to find the actual address.
So an A record is the end of the chain; a CNAME is a pointer to somewhere else that eventually ends in an A or AAAA record.
When to use a CNAME
CNAMEs shine when you do not want to track an IP that might change. Hosting platforms like Vercel, Netlify, and many CDNs tell you to point your subdomain at a hostname they control with a CNAME, so they can change the underlying IPs freely without you touching DNS. Use a CNAME whenever the target is a managed name that may move.
The rule that trips everyone up
You cannot put a CNAME at the domain root (the apex, example.com itself). The DNS standard forbids it, because the apex must carry other records (like NS and MX) that a CNAME would conflict with. So example.com cannot be a CNAME, even though www.example.com can.
Providers work around this with ALIAS or ANAME records, or by flattening the CNAME to A records automatically. If your host platform gives you a hostname but your apex needs to point at it, this is the feature to look for.
Quick decision
Use an A record for the apex and anywhere you have a stable IP; use a CNAME for subdomains pointing at a managed platform hostname. You can check what any name currently resolves to with the DNS Lookup tool, and DNS records explained covers the full set.