bind9/bin/tests/system/dnstap
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
..
ns1 Remove license headers from test zone files 2026-03-31 17:57:58 +02:00
ns2 Remove license headers from test zone files 2026-03-31 17:57:58 +02:00
ns3 Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
ns4 Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
ns5 Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-reopen-interval.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-buffer-hint-max.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-buffer-hint-min.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-flush-timeout-max.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-flush-timeout-min.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-input-queue-size-max.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-input-queue-size-min.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-input-queue-size-po2.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-output-notify-threshold.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-output-queue-size-max.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-output-queue-size-min.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-reopen-interval-max.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-fstrm-set-reopen-interval-min.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-missing-dnstap-output-view.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-missing-dnstap-output.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
bad-size-version.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-dnstap-in-options.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-dnstap-in-view.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-reopen-interval.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-buffer-hint.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-flush-timeout.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-input-queue-size.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-output-notify-threshold.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-output-queue-model-mpsc.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-output-queue-model-spsc.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-output-queue-size.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-fstrm-set-reopen-interval.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-size-unlimited.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
good-size-version.conf Remove license headers from named.conf test files 2026-03-31 17:57:58 +02:00
large-answer.fstrm dnstap-read: clear buffer before expanding it 2019-06-28 12:43:51 +02:00
README Remove fixed value for the rrset-order option 2024-12-09 13:09:26 +01:00
tests.sh Rename view->hints to view->rootdb and rearm priming 2026-04-16 13:39:18 +02:00
tests_dnstap.py Clean up imports of dnspython modules 2026-02-20 15:17:32 +01:00
tests_sh_dnstap.py Use pytest.mark.flaky as the flaky marker 2025-07-07 13:29:15 +02:00
ydump.py Automatically sort imports in Python code 2026-02-20 15:17:32 +01:00

Copyright (C) Internet Systems Consortium, Inc. ("ISC")

SPDX-License-Identifier: MPL-2.0

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0.  If a copy of the MPL was not distributed with this
file, you can obtain one at https://mozilla.org/MPL/2.0/.

See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.

The "large-answer.fstrm" file was generated by configuring a named instance
compiled with --enable-dnstap with the following directives:

    minimal-responses yes;
    dnstap { auth response; };
    dnstap-identity none;
    dnstap-output file "large-answer.fstrm";

The captured RRset from the "example." zone was created using:

    $GENERATE 1-48 @ IN A 127.0.0.$

A server instance set up this way was then queried non-recursively (RD=0) for
"example/A".