]> git.ipfire.org Git - thirdparty/bind9.git/commit
test for auth+res server and glues in delegation
authorColin Vidal <colin@isc.org>
Fri, 27 Mar 2026 15:00:25 +0000 (16:00 +0100)
committerColin Vidal <colin@isc.org>
Mon, 30 Mar 2026 18:41:13 +0000 (20:41 +0200)
commitea2cb4e9df52d0eadcf87d0c49df258c51a02a71
tree9ca0c3eab52e5f8fea121af1d7386c9738267651
parentdc6202479f00aade2ada48e72ce35d45a1062235
test for auth+res server and glues in delegation

When a resolver+auth server has a delegation on a local zone and has a
glue, the glue can only be for in-domain NS.

In this case, when the resolver is looking at the zonecut,
`dns_view_bestzonecut()` synthesizes a delegset from an NS rdataset
found in the local zone (the delegation inside auth zone), and ignores
the glues if any.

As a result, the delegset will contain a single delegation of type
DNS_DELEGTYPE_NS_NAMES, which leads to an ADB fetch. But it's actually an
in-memory fetch, because in this case, the fetch will immediately find
the A/AAAA glues from the local zone.

An alternative approach (not chosen here) would be to make
`dns_view_bestzonecut()`, when converting an NS rdataset into a
`dns_deleg_t`, check for glues for the delegation in the auth zone, and
add those in the `dns_deleg_t`. The delegation would be of type
DNS_DELEGTYPE_NS_GLUES which would avoid the ADB name lookup.

However, that's extra code, extra logic and complexities, for a lookup
that will be done in memory anyway, just a bit later. So for now, this
is not implemented that way.

The test is added, however, to confirm that there is no attempt from the
resolver to get the NS fron the child zone.
bin/tests/system/auth_res_deleg/README [new file with mode: 0644]
bin/tests/system/auth_res_deleg/ns1/named.conf.j2 [new file with mode: 0644]
bin/tests/system/auth_res_deleg/ns1/root.db [new file with mode: 0644]
bin/tests/system/auth_res_deleg/ns2/example.db [new file with mode: 0644]
bin/tests/system/auth_res_deleg/ns2/named.conf.j2 [new file with mode: 0644]
bin/tests/system/auth_res_deleg/ns3/named.conf.j2 [new file with mode: 0644]
bin/tests/system/auth_res_deleg/ns3/sub.example.db [new file with mode: 0644]
bin/tests/system/auth_res_deleg/tests_auth_res_deleg.py [new file with mode: 0644]
lib/dns/view.c
lib/ns/query.c