Skip to main content

6. Name Error Bugs

This bug is very similar to the Zero Answer bug. A server returns an authoritative NXDOMAIN when the queried name is known to be bad, by the server authoritative for the domain, in the absence of negative caching. This authoritative NXDOMAIN response is usually accompanied by the SOA record for the domain, in the authority section.

Resolvers should recognize that the name they queried for was a bad name and should stop querying further.

Some resolvers might, however, not interpret this correctly and continue to query servers, expecting an answer record.

Some applications, in fact, prompt NXDOMAIN answers! When given a perfectly good name to resolve, they append the local domain to it e.g., an application in the domain "foo.bar.com", when trying to resolve the name "usc.edu" first tries "usc.edu.foo.bar.com", then "usc.edu.bar.com" and finally the good name "usc.edu". This causes at least two queries that return NXDOMAIN, for every good query. The problem is aggravated since the negative answers from the previous queries are not cached. When the same name is sought again, the process repeats.

Some DNS resolver implementations suffer from this problem, too. They append successive sub-parts of the local domain using an implicit searchlist mechanism, when certain conditions are satisfied and try the original name, only when this first set of iterations fails. This behavior recently caused pandemonium in the Internet when the domain "edu.com" was registered and a wildcard "CNAME" record placed at the

top level. All machines from "com" domains trying to connect to hosts in the "edu" domain ended up with connections to the local machine in the "edu.com" domain!

Good/Bad Implementations​

Some local versions of BIND already implement negative caching. They typically cache negative answers with a very small TTL, sufficient to answer a burst of queries spaced close together, as is typically seen.

The next official public release of BIND (4.9.2) will have negative caching as an ifdef'd feature.

The BIND resolver appends local domain to the given name, when one of two conditions is met:

  • i. The name has no periods and the flag RES_DEFNAME is set. ii. There is no trailing period and the flag RES_DNSRCH is set.

The flags RES_DEFNAME and RES_DNSRCH are default resolver options, in BIND, but can be changed at compile time.

Only if the name, so generated, returns an NXDOMAIN is the original name tried as a Fully Qualified Domain Name. And only if it contains at least one period.

Fixes​

  • a. Fix the resolver code.

  • b. Negative Caching. Negative caching servers will restrict the traffic seen on the wide-area network, even if not curb it altogether.

  • c. Applications and resolvers should not append the local domain to names they seek to resolve, as far as possible. Names interspersed with periods should be treated as Fully Qualified Domain Names.

In other words, Use searchlists only when explicitly specified. No implicit searchlists should be used. A name that contains any dots should first be tried as a FQDN and if that fails, with the local domain name (or searchlist if specified) appended. A name containing no dots can be appended with the searchlist right away, but once again, no implicit searchlists should be used.

Associated with the name error bug is another problem where a server might return an authoritative NXDOMAIN, although the name is valid. A secondary server, on start-up, reads the zone information from the primary, through a zone transfer. While it is in the process of loading the zones, it does not have information about them, although it is authoritative for them. Thus, any query for a name in that domain is answered with an NXDOMAIN response code. This problem might not be disastrous were it not for negative caching servers that cache this answer and so propagate incorrect information over the internet.

Bad Implementation​

BIND apparently suffers from this problem.

Also, a new name added to the primary database will take a while to propagate to the secondaries. Until that time, they will return NXDOMAIN answers for a good name. Negative caching servers store this answer, too and aggravate this problem further. This is probably a more general DNS problem but is apparently more harmful in this situation.

Fix​

  • a. Servers should start answering only after loading all the zone data. A failed server is better than a server handing out incorrect information.

  • b. Negative cache records for a very small time, sufficient only to ward off a burst of requests for the same bad name. This could be related to the round-trip time of the server from which the negative answer was received. Alternatively, a statistical measure of the amount of time for which queries for such names are received could be used. Minimum TTL value from the SOA record is not advisable since they tend to be pretty large.

  • c. A "PUSH" (or, at least, a "NOTIFY") mechanism should be allowed and implemented, to allow the primary server to inform secondaries that the database has been modified since it last transferred zone data. To alleviate the problem of "too many zone transfers" that this might cause, Incremental Zone Transfers should also be part of DNS. Also, the primary should not NOTIFY/PUSH with every update but bunch a good number together.