]> git.ipfire.org Git - thirdparty/bind9.git/commit
If possible don't use forwarders when priming the resolver.
authorWitold Kręcicki <wpk@isc.org>
Thu, 3 Jan 2019 13:58:05 +0000 (14:58 +0100)
committerEvan Hunt <each@isc.org>
Thu, 17 Jan 2019 00:32:43 +0000 (16:32 -0800)
commitf8963ad70e222edad0c1e64f855f7fb41fb13c3c
treef9a68df07d98e3a32c02b6cbc2c9df762929760d
parentbe7ba5fbe21ab7dc47fa9b396eab243ed0a3d0f4
If possible don't use forwarders when priming the resolver.

If we try to fetch a record from cache and need to look into
hints database we assume that the resolver is not primed and
start dns_resolver_prime(). Priming query is supposed to return
NSes for "." in ANSWER section and glue records for them in
ADDITIONAL section, so that we can fill that info in 'regular'
cache and not use hints db anymore.
However, if we're using a forwarder the priming query goes through
it, and if it's configured to return minimal answers we won't get
the addresses of root servers in ADDITIONAL section. Since the
only records for root servers we have are in hints database we'll
try to prime the resolver with every single query.

This patch adds a DNS_FETCHOPT_NOFORWARD flag which avoids using
forwarders if possible (that is if we have forward-first policy).
Using this flag on priming fetch fixes the problem as we get the
proper glue. With forward-only policy the problem is non-existent,
as we'll never ask for root server addresses because we'll never
have a need to query them.

Also added a test to confirm priming queries are not forwarded.

(cherry picked from commit b49310ac06ac87733dc2867828e61370a84b2a9a)
CHANGES
bin/tests/system/forward/ns4/named.conf.in
bin/tests/system/forward/ns7/named.conf.in [new file with mode: 0644]
bin/tests/system/forward/ns7/root.db [new file with mode: 0644]
bin/tests/system/forward/setup.sh
bin/tests/system/forward/tests.sh
lib/dns/include/dns/resolver.h
lib/dns/resolver.c
util/copyrights