CNAME vs A Record: Which Does Your Name Use?
Look up a host name to see whether it uses a CNAME or A records, then compare how the two behave.
Recent
Your last 10 settings, saved only in this browser. Nothing is uploaded.
Get notified about new checks and updates
We send a short email only when we add a new tool or make a major change to one — no newsletter, no ads, never shared. To unsubscribe, email support@360jiance.com with the word “unsubscribe” and we delete your address. What we store.

How to use the CNAME vs A record tool
- Find the host name box. It starts with www.github.com. Replace it with the name you want to check, such as www.microsoft.com or example.com.
- Choose a resolver from the resolver list, either Cloudflare or Google.
- Press Look up.
- Read the “This name uses” row. It shows a CNAME with its target and number of hops, A and AAAA records with their counts, or neither.
- Read the “Zone apex” row. Yes means the name is the top name of its zone. No means it is a name inside a zone.
- Read the Status row and any messages. The tool flags a CNAME at the apex, a CNAME chain that loops, and an alias whose target does not exist (NXDOMAIN, dangling).
- Scroll to the “CNAME vs A record” table to compare how each record type behaves. Run the dig or nslookup commands shown below it if you want to repeat the same query yourself.
Before you press Look up, the page shows a recorded example, so you can see the layout first. For a quick comparison, try www.github.com (a CNAME with 1 hop), github.com (an apex with A records), and www.microsoft.com (a CNAME chain of 2 hops).
What is the difference between a CNAME and an A record?
A CNAME record says that one name is an alias for another name, called the canonical name (RFC 1034 section 3.6.2, RFC 1035 section 3.3.1). An A record maps a name directly to an IPv4 address (RFC 1035 section 3.4.1). AAAA does the same job for IPv6 (RFC 3596). In short, a CNAME points to another name, and an A record points to a number.
This difference changes how a name behaves. A resolver that meets a CNAME needs at least two lookups: first the alias, then the address of the target. An A record answers in a single lookup. The CNAME approach also has a maintenance benefit. If the target changes its IP addresses, the alias follows automatically. With an A record, you must edit the record yourself when the IP address changes.
For example, www.github.com is a CNAME for github.com, so it has 1 hop. github.com itself holds A records. The tool shows both results so you can see which kind of name you are looking at.
Can a CNAME be used at the root domain?
No. The apex of a zone, such as example.com itself, always holds SOA and NS records. A CNAME cannot sit beside other data on the same name, so a CNAME at the apex is invalid. At an apex, use A and AAAA records. The tool shows example.com as an apex with A and AAAA records.
Some DNS hosts offer ALIAS, ANAME or CNAME flattening. These features answer queries for the apex with A records, so they work at the root. They are provider features, not DNS record types, and they depend on the host that offers them. If you see a CNAME at the apex, the tool flags it as invalid, and you should replace it with A and AAAA records or use your provider’s feature.
Worked examples
| Input | Result |
|---|---|
| www.github.com | A CNAME: an alias of github.com (1 hop) |
| github.com | A and AAAA records: 1 IPv4, 0 IPv6 addresses |
| www.microsoft.com | A CNAME: an alias of e13678.dscb.akamaiedge.net (2 hops) |
| example.com | A and AAAA records: 2 IPv4, 2 IPv6 addresses |
Calculated by the tool above; open it with the same values to see each step.
Frequently asked questions
Can a CNAME and an A record exist on the same name?
No. A name that has a CNAME may have no other data, except DNSSEC signature records (RFC 1034 section 3.6.2, RFC 2181 section 10.1). You cannot put a CNAME next to an MX, TXT or A record on the same name.
Should I use a CNAME or an A record?
Use A and AAAA records at the zone apex, because a CNAME is not allowed there. Inside a zone, use a CNAME when the name should follow another name’s addresses automatically. Use an A or AAAA record when you want the fewest lookups and are willing to edit the record if the IP address changes.
When should I use a CNAME?
Use a CNAME for a name inside a zone that should be an alias for another name, such as a subdomain that points to a service run by a provider. The provider can then change its IP addresses without you editing your DNS. Do not use a CNAME at the apex.
Can an MX record point to a CNAME?
No. MX and NS records must point to names that have address records, not to aliases (RFC 2181 section 10.3). Point the MX record to the host name that holds the A or AAAA record directly.
What does the number of hops mean in “This name uses”?
Hops count how many CNAME links you must follow before reaching a name with address records. www.github.com has 1 hop, and www.microsoft.com has 2 hops, ending at e13678.dscb.akamaiedge.net. More hops mean more lookups before an address is returned.
What does a dangling CNAME mean?
A dangling CNAME is an alias whose target does not exist, so the lookup returns NXDOMAIN. The tool flags this in its messages. To fix it, correct the target name or remove the CNAME.
Related tools
- CNAME Lookup: Use it when you only need to check whether a name is a CNAME and where it points.
- A Record Lookup: Use it when you want the IPv4 addresses a name resolves to.
- DNS Record Types: Use it to learn what each record type does before you change a zone.
- MX Lookup: Use it to check the mail server records for a domain and confirm they point to address names.
- NS Lookup: Use it to see which nameservers a zone uses, which must not point to aliases.