bind9/bin
Ondřej Surý 0c007d8659
Rename view->hints to view->rootdb and rearm priming
With the parent-centric resolver, dns_view_bestzonecut() consults the
delegation DB (view->deleg) rather than the main cache for the closest
zonecut.  Root is never the target of a referral, so it never lands in
delegdb; bestzonecut therefore falls through to the hints lookup on
every query whose closest ancestor is root.  prime_done() only called
dns_root_checkhints(), which logs discrepancies but does not update
any store bestzonecut looks at, so the fresh root NS records obtained
by priming were never used and priming kept re-firing.

Rename view->hints to view->rootdb and refresh it when a priming
fetch completes: the '.' NS rdataset is replaced with the fetched
one, and for each listed nameserver the matching A/AAAA glue is
copied from the response's ADDITIONAL section.  Only glue for names
that actually appear as NS targets is accepted, so a hostile response
cannot inject unrelated records.  Glue the response did not carry is
left untouched, so the hints-file records loaded at startup remain as
a fallback.

Each view gets its own rootdb: the previous shared
named_g_server->in_roothints is gone, and configure_view() calls
dns_rootns_create() per view when the class-IN defaults are needed.
That keeps the priming writer one-per-DB, so concurrent priming in
different views cannot race on the same zone-DB version.

The rootdb refresh runs synchronously from the resolver response path,
so records go straight from the wire into rootdb with no cache round
trip and no dependency on DNSSEC validation state.  A new
DNS_FETCHOPT_PRIMING option marks the priming fetch; prime_done()
itself is now pure cleanup.

Track the rootdb freshness window in view->rootdb_expires and trigger
re-priming lazily from dns_view_find() and bestzonecut_rootdb() only
when the window has elapsed.  Stale records are still served while the
fresh priming fetch is in flight.

Drop dns_root_checkhints() and its helpers; the rootdb is now the
authoritative source the resolver consults.
2026-04-16 13:39:18 +02:00
..
check Move zone set/get properties to own source file 2026-04-02 15:50:07 +02:00
confgen Change the 'isc_g_mctx' to be always available 2025-08-04 11:29:50 +02:00
delv Rename view->hints to view->rootdb and rearm priming 2026-04-16 13:39:18 +02:00
dig Add examples to the dig man page 2026-02-22 11:03:10 -05:00
dnssec Change NSEC3 and NSEC3PARAM struct fields to use isc_region_t 2026-04-02 16:53:18 +02:00
include Remove NZF support, make LMDB required for new zone storage 2026-03-18 11:02:33 +01:00
named Rename view->hints to view->rootdb and rearm priming 2026-04-16 13:39:18 +02:00
nsupdate nsupdate does not handle zero length RDATA well 2026-04-09 09:24:47 +10:00
plugins Apply the dns_rdataset_cleanup patch through the codebase 2025-12-17 15:19:55 +01:00
rndc Dump delegation database in 'rndc dumpdb' 2026-03-30 20:41:13 +02:00
tests Rename view->hints to view->rootdb and rearm priming 2026-04-16 13:39:18 +02:00
tools Remove NZF support, make LMDB required for new zone storage 2026-03-18 11:02:33 +01:00
meson.build replace the build system with meson 2025-06-11 10:30:12 +03:00