CNAME Lookup

Resolve a hostname alias to its canonical target

Guide

A CNAME lookup shows whether a hostname is an alias pointing to another hostname, and reveals the canonical target that browsers and mail servers actually connect to.

What is a CNAME record?

A Canonical Name (CNAME) record maps one hostname to another. It does not point to an IP address directly - instead it tells resolvers "the real name for this host is somewhere else, go look up that name instead." The resolver then follows the chain and resolves whatever A, AAAA, or other records exist on the target.

CNAMEs are the standard way to point a subdomain at infrastructure you do not control the IP for: a CDN edge, a hosting platform, a SaaS custom-domain feature. If the provider changes its IP addresses, every domain aliased through a CNAME follows automatically - nobody has to update DNS records for each customer.

  • A CNAME target must itself resolve to an A/AAAA (or another CNAME); it never holds an IP address
  • Resolution can chain through several CNAMEs before reaching a final A/AAAA record
  • CNAMEs carry no information about mail routing, TXT policies, or anything else - only the alias target

The apex constraint

RFC 1034 section 3.6.2 requires that if a name has a CNAME record, that name can have no other record types - no A, no MX, no TXT alongside it. This is why a zone apex (the bare domain, "example.com" with no subdomain) almost never carries a CNAME: the apex needs an NS record set (delegation) and usually an SOA record too, and those cannot coexist with a CNAME on the same name.

In practice this means "www.example.com" can be a CNAME to a hosting provider, but "example.com" itself cannot - it needs A/AAAA records, or a provider-specific workaround.

NameCan hold a CNAME?Why
www.example.comYesOrdinary subdomain, no competing record types required
example.com (apex)NoNeeds NS/SOA at minimum; RFC 1034 forbids CNAME alongside other records
_dmarc.example.comNo (in practice)Must hold a TXT record for the DMARC policy, incompatible with CNAME

CNAME vs ALIAS vs ANAME

Because the apex cannot hold a CNAME, several DNS providers invented a non-standard workaround under names like ALIAS, ANAME, or "CNAME flattening." These are not a DNS record type defined by any RFC - they are a provider-side feature: the nameserver resolves the target itself and answers apex queries with A/AAAA records directly, synthesizing the result so the wire response never violates RFC 1034.

Behavior varies by provider - refresh intervals, chain-following depth, and DNSSEC interaction are all implementation-specific. If you move providers, an ALIAS/ANAME record does not travel with the zone file in the same way a standard CNAME does; check the target provider supports an equivalent before relying on it at the apex.

Reading CNAME lookup results

A successful lookup returns one CNAME record for the queried hostname, showing the canonical target it resolves to. If the target itself is another CNAME, a full trace would show the whole chain - this tool reports the direct target returned for the queried name, which is what a recursive resolver stores as the immediate answer.

No CNAME record found for a hostname does not mean the domain is unreachable - it simply means that name is not an alias. Most apex domains correctly return no CNAME because they use direct A/AAAA records instead.

FieldExample valueMeaning
namewww.example.comThe hostname you queried
valueexample-cdn.provider.netThe canonical target this name is an alias for
typeCNAMEConfirms the record class returned

FAQ

Can I put a CNAME on my root domain (the apex)?

Not as a standard DNS record - RFC 1034 forbids a CNAME from coexisting with the NS/SOA records every apex needs. Some DNS providers offer a proprietary ALIAS or ANAME feature that behaves like a CNAME at the apex by resolving the target on the server side, but it is not a portable standard and behavior differs between providers.

Why does my mail stop working after I add a CNAME?

If you added a CNAME on a name that also needs an MX, TXT, or other record - for example on the bare domain or on a subdomain already used for mail - the CNAME silently supersedes those other record types per RFC 1034, and resolvers may only see the alias. Keep CNAMEs on names that do not need any other DNS record.

How many CNAME records can point to the same target?

There is no protocol limit. Many hostnames can each carry their own CNAME record pointing at the same target, which is exactly how CDNs and SaaS platforms let thousands of customer subdomains share one piece of infrastructure.

Does a CNAME slow down DNS resolution?

Each link in a CNAME chain adds one more DNS query the resolver must follow before it gets an A/AAAA answer, so a long chain (CNAME to CNAME to CNAME) adds latency compared to a direct A record. A single CNAME hop is negligible; provider-to-provider aliasing that stacks three or four hops is where the delay becomes noticeable.

Is CNAME flattening the same thing as a CNAME record?

No. CNAME flattening (also sold as ALIAS or ANAME) is a provider-specific technique that answers apex queries with A/AAAA records the server resolved on your behalf, so the response on the wire is not actually a CNAME. It exists specifically to work around the rule that a real CNAME cannot sit at the apex.

Why does my CNAME lookup return nothing even though the subdomain works?

The subdomain may be using a direct A or AAAA record instead of a CNAME, which is a valid and common setup. A working hostname does not require a CNAME - it only needs some record type that resolves to a usable address.

Related tools