CNAME vs A Record
Use an A record to point a domain to an IP address, and a CNAME to point a hostname to another hostname — common for subdomains linking to external services. CNAMEs cannot coexist with other records on the same name, so they cannot sit on a root domain. The checker on this page identifies which type your setup needs.
Closest fit
Every class, ranked
This is a category, not a company. Any host selling that category can serve you well or badly; the checks below are how you tell them apart.
Before you pay, check these four things
What Each Record Does
An A record maps a domain name to an IPv4 address. When a browser resolves example.com, it looks up the A record to find the server's IP address, then connects directly. An A record is a static pointer — if the server's IP changes, you must update the record manually. The AAAA record works identically but maps to an IPv6 address.
A CNAME record maps one hostname to another hostname. Instead of resolving to an IP directly, the resolver follows the CNAME to the target name and then resolves that. This adds one extra lookup step but provides flexibility: if the target service changes its IP address, your CNAME still works because it follows the name, not the number. This is why services like e-commerce platforms and CDNs instruct you to create a CNAME — they can update their infrastructure without every customer needing to change DNS.
The Root Domain Restriction
RFC 1035 specifies that a CNAME record cannot coexist with any other record type on the same hostname. Because your root domain (example.com without a subdomain prefix) must also carry NS records and usually an MX record, placing a CNAME there violates the specification. Some DNS providers work around this with proprietary record types — ALIAS, ANAME, or CNAME flattening — that behave like a CNAME at the root but resolve to an A record before responding to queries.
For subdomains, no such restriction exists. Pointing shop.example.com via CNAME to your e-commerce platform is standard practice and works everywhere.
| Scenario | Record type |
|---|---|
| Root domain to your server's IP | A (and AAAA) |
| Subdomain to an external service | CNAME |
| Root domain to an external service | ALIAS/ANAME (if supported) or A |
The tool on this page checks your current DNS and recommends the correct record type based on what you are connecting.
If you change from an A record to a CNAME or vice versa, delete the old record first. Having both an A and a CNAME on the same hostname causes unpredictable resolution behaviour.
Next in this cluster
Related guides and tools
Sources
-
CNAME exclusivity rule per RFC 1035, Section 3.6.2. ALIAS/ANAME workarounds are provider-specific extensions not standardised in IETF RFCs.
- Every figure in the calculators on this site is typed in by you. No price, allowance or renewal rate is stored in the page.