Can a DNS server return NXDOMAIN and an unresolved CNAME even though the alias exists

domain-name-system

I'm trying to understand why one given DNS server is not resolving our domain correctly.

When I look up www.foo.com from this name server, a CNAME foo.bar.cc is correctly returned but there's no attached A record and the response status is NXDOMAIN. I understand that this could happen if the DNS server can not resolve the alias foo.bar.cc. However, if I use the same DNS server and look up foo.bar.cc directly, I always get the correct A record.

When using any other DNS servers I've tested (different ISPs, Google DNS, Open DNS) our domain resolves correctly.

Given this situation, is there some possible problem in our DNS that could cause this? Or does it seem like this given DNS server is to blame? The DNS server in question is used by a lot of people and it seems more likely that the problem is caused by us, but I don't see how – any clues?

Best Answer

Although this DNS configuration is terribly slow and error prone, there's no DNS to blame, and your record is working correctly.

Here's what happens. When you query ns1.sonic.net about en.greatfire.org, this server is configured to answer for greatfire.org, but it does not have a record for en.greatfire.org and returns a default CNAME en.greatfire.org.24680.info.

This CNAME now is NOT in the zone of ns1.sonic.net: it belongs to zone 24680.info. So if you attempt to resolve it through ns1.sonic.net, you'll get an error. Instead, this name must be resolved starting from scratch from the root, down through the .info authorities.

The other DNS services you mention will respond for the CNAME because they are not DNS servers, they are DNS resolvers, so they will perform the entire procedure for you and return only the result.

Use dig +trace or the Delegation Lab to figure out who's authoritative for those zones and who you are supposed to query instead: