CNAME vs A Record — When to Use Which
Understand the key differences between CNAME and A records, and learn when to use each for optimal DNS configuration.
Diagnose your site now
Problem
You need to add a DNS record but aren’t sure whether to use a CNAME or an A record.
Key Differences
| Feature | A Record | CNAME Record |
|---|---|---|
| Points to | IP address (e.g., 93.184.216.34) | Another domain (e.g., cdn.example.net) |
| Zone apex | Allowed | Not allowed (RFC 1034) |
| Extra lookup | No | Yes (one additional resolution) |
| Use case | Root domain, direct IP mapping | Subdomains, CDN, cloud services |
Top 3 Decision Rules
- Root domain (
example.com) → Always use an A (or AAAA) record. CNAME is not valid at the zone apex. - Subdomain pointing to a cloud service (e.g.,
app.example.com→myapp.herokuapp.com) → Use CNAME so the target IP can change without updating your DNS. - Subdomain with a known, static IP → A record is simpler and avoids the extra lookup.
Diagnosis with DechoNet
- DNS Lookup — Query your domain and check the Records tab to see which record types are configured.
- Verify CNAME targets resolve correctly by looking up the target domain.
Resolution Checklist
- Use A/AAAA for the root domain (
example.com). - Use CNAME for subdomains that point to external services (CDN, PaaS, SaaS).
- Never mix CNAME with other record types on the same name (MX, TXT, etc.).
- If your DNS provider supports ALIAS/ANAME, you can use it as a CNAME-like record at the apex.
- After changes, verify with DechoNet DNS Lookup that records resolve as expected.
Related Tools
Related Guides
Share this guide
[Ad] Guide Detail Inline