質問

We use RH5.8 with ipv6 disabled.

named(bind) service is in forward mode (cache enabled)

options {
   directory "/var/named";
   listen-on { 127.0.0.1; };
   forwarders {10.10.12.1;};
   forward only;
};

It appears that some commands (like telnet) always query AAAA record in the first place and when fallback to query A record the answer (No such name) already in named caching.

As a result, clients are always getting an error.

in the example below, 10.10.10.1 is a local ip:

127.0.0.1 -> 127.0.0.1    DNS Standard query AAAA testapp.test.com

10.10.10.1 -> 10.10.12.1 DNS Standard query AAAA testapp.test.com

10.10.10.1 -> 10.10.12.1 DNS Standard query AAAA testapp.test.com

10.10.12.1 -> 10.10.10.1 DNS Standard query response, No such name

127.0.0.1 -> 127.0.0.1    DNS Standard query response, No such name

127.0.0.1 -> 127.0.0.1    DNS Standard query A testapp.test.com

127.0.0.1 -> 127.0.0.1    DNS Standard query response, No such name

I searched over net and discovered that not only me encountered with such problem http://www.linuxforums.org/forum/red-hat-fedora-linux/136217-disabling-ipv6-dns-queries.html

less /etc/modprobe.conf
  alias net-pf-10 off
  alias ipv6 off
  options ipv6 disable=1

less /etc/sysconfig/network
 NETWORKING_IPV6=no

less /etc/sysconfig/named
 OPTIONS="-4"

named -v
 BIND 9.3.6-P1-RedHat-9.3.6-20.P1.el5

but unfortunately did not find any solution so far...

役に立ちましたか?

解決

As requested in the comments: some explanation on negative cacheing.

The difference between NXDOMAIN and NODATA is described in section 5 of RFC 2308:

A negative answer that resulted from a name error (NXDOMAIN) should be cached such that it can be retrieved and returned in response to another query for the same <QNAME, QCLASS> that resulted in the cached negative response.

So an NXDOMAIN can be cached based on the QNAME (i.e. "blabla.example.com.") and the QCLASS (usually "IN"). So it means that blabla.example.com does not exist at all. The negative cache entry is independent of the QTYPE. A NODATA answer is different:

A negative answer that resulted from a no data error (NODATA) should be cached such that it can be retrieved and returned in response to another query for the same <QNAME, QTYPE, QCLASS> that resulted in the cached negative response.

Here is QTYPE (i.e. "AAAA") is included. A NODATA negative cache entry only means that this specific record type does not exist for this name.

So: If you receive an NXDOMAIN response then you know that the name doesn't exist at all for any record type. If you receive a NODATA response then you know that the requested record type does not exist, but other record types may exist.

This also means that when sending responses you should never send an NXDOMAIN response if there may be a valid record of a different record type for the same name. The non-existence of the domain name will be cached and the cache will start telling its clients that the name doesn't exist at all.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top