CNAME lookup
See whether a hostname is an alias and which name it points to, one hop at a time.
What a CNAME record is
A CNAME (canonical name) record says that one hostname is an alias for another. If www.example.com has a CNAME to shops.example-platform.net, every question about www, such as its addresses, is answered by looking at the target instead. Resolvers follow the alias for you, and may pass through several in a row.
CNAMEs are the usual way to connect your domain to a service that changes its IP addresses, such as a website builder, a CDN, a hosted shop, a status page or an email-sending service. You publish the alias once, and the provider updates the addresses behind it.
How to follow an alias
- Look up the subdomainEnter the full name, such as
shop.example.com. A CNAME is set on one specific name, not on the whole domain. - Follow the chainIf a target comes back, look that name up too. Or run an A lookup on the original name, which shows the whole chain at once. A healthy chain ends at an A or AAAA record. One that ends in an error is broken.
- Check that the target is still yours to useA CNAME that points at a cloud or SaaS resource you have deleted can be claimed by someone else. See the warning below.
The rules a CNAME must follow
- A CNAME cannot share a name with other records. If
shop.example.comis a CNAME, it cannot also have MX, TXT or A records (RFC 1034, RFC 2181). The only exceptions are the DNSSEC records that sign it. - No CNAME at the root of a domain. The root already holds SOA and NS records, so
example.comcannot be a CNAME. Use A and AAAA records instead, or the ALIAS, ANAME or CNAME flattening feature your DNS host may offer. These return addresses and behave like a CNAME. - MX and NS targets must not be CNAMEs. Mail servers and nameservers need real address records (RFC 2181 section 10.3).
- Keep chains short. Each hop is another query. Long chains slow things down, and some resolvers give up after a limit.
- Mind the trailing dot. In a zone file, a target without a dot at the end is treated as relative to the zone. That is how
target.example.com.example.commistakes happen.
Common problems
- “CNAME not allowed” in the DNS panel. Another record already exists at that name. Delete the conflicting record, or change the existing record instead.
- The root domain refuses a CNAME. Use your host's ALIAS or flattening feature, or an A record with the provider's fixed address.
- The provider says it can't find your CNAME. Your DNS host may add your domain automatically, so entering
www.example.combecomeswww.example.com.example.com. Enter justwww. - Verification CNAMEs. Services for email signing and certificate validation ask for names like
selector._domainkeyor_acme-challenge. They are fine as long as nothing else lives at that exact name. - Proxied records. If your DNS host proxies a CNAME, as some CDNs do, a lookup returns the proxy's addresses and not the CNAME itself.
- NXDOMAIN at the end of the chain. The target does not exist. Check for a typo or a removed service.
How the lookup works and the standards
LookupOwl asks for type CNAME (code 5) at the exact hostname and shows the record, with its target and TTL, if there is one. A CNAME query returns only the first link. To follow a chain, look up each target in turn, or ask for the A or AAAA records of the original name, where the resolver returns every alias on the way along with the final addresses. A name with more than one CNAME is flagged as an error. The CNAME record is defined in RFC 1035, and its constraints are in RFC 1034 section 3.6.2 and RFC 2181 section 10.1. The rule for MX and NS targets is in RFC 2181 section 10.3.
dig +short CNAME www.example.com
dig www.example.com A +noall +answer # shows the whole chainOnce you know where the alias ends, check the final addresses with an A record lookup.
Questions people ask
What is a CNAME record used for?
A CNAME makes one hostname an alias for another, so you do not have to track the target's IP addresses yourself. It is widely used for www, CDNs, hosted services and verification records. When the provider changes its servers, your alias keeps working without any edit on your side.
Can I put a CNAME on my root domain?
Not as a true CNAME, because the root must hold SOA and NS records. Many DNS providers offer ALIAS or CNAME flattening instead, which gives you the same convenience safely by returning addresses. If yours does not, use an A record with the provider's fixed address.
What is the difference between a CNAME and an A record?
An A record holds an IP address, and a CNAME holds another name. Use an A record when you control a fixed address. Use a CNAME when a provider manages the address for you and may change it. A CNAME costs one extra lookup, and it cannot sit next to other records.
Can I have a CNAME and a TXT record on the same name?
No. A CNAME must be the only record at its name, apart from the DNSSEC records that sign it. If you need both, move one of them to a different name. Many DNS panels block the combination, and if one lets it through, different resolvers may give different answers.
Does a CNAME slow down my site?
Only very slightly. Each alias adds one more lookup the first time a resolver needs it. Resolvers then cache the whole chain, so visitors rarely notice. It only matters when a chain is long, which is a good reason to keep chains to one or two hops.
How do I know whether a CNAME is dangling?
Look up the target. If it returns NXDOMAIN, or resolves to a provider's generic “not found” page, the resource behind it is gone. Delete the CNAME, because someone else could claim that target and serve content on your subdomain.
Use it from AI, the API or the command line
Every LookupOwl tool is also a free API and an MCP tool, with no key and no account. This one is dns_lookup. Please be kind to the rate limits.
curl "https://lookupowl.com/api/v1/tools/dns-lookup?q=www.github.com"claude mcp add --transport http lookupowl https://lookupowl.com/mcp