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

FeatureA RecordCNAME Record
Points toIP address (e.g., 93.184.216.34)Another domain (e.g., cdn.example.net)
Zone apexAllowedNot allowed (RFC 1034)
Extra lookupNoYes (one additional resolution)
Use caseRoot domain, direct IP mappingSubdomains, CDN, cloud services

Top 3 Decision Rules

  1. Root domain (example.com) → Always use an A (or AAAA) record. CNAME is not valid at the zone apex.
  2. Subdomain pointing to a cloud service (e.g., app.example.commyapp.herokuapp.com) → Use CNAME so the target IP can change without updating your DNS.
  3. 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
← Back to All Guides