For the technical audience
Decisions ADR-201 to ADR-204
Every architecture decision record (ADR) behind TelltaleDNS: what we knew, what we chose, and what it costs. This page is built from the specification on every change, so it's always the current record.
ADR-201 A bogus answer is validated once more through another member of its group, never through the member that answered its question; only a secure or insecure answer replaces itGitHub issue #107 (rough-ton): with several upstreams in a group, an answer that doesn't validate ends in SERVFAIL with EDE 6, although another member has a good answer.
Context
GitHub issue #107 (rough-ton): with several upstreams in a group, an answer that doesn't validate ends in SERVFAIL with EDE 6, although another member has a good answer. The reporter showed it with a stub that strips signatures: with failover and the stub first, 12 questions of 12 failed. The validator took the group's first answer, and a bogus verdict ended the question. An answer that fails validation still counts as a success for its member's health (the member answered), so failover asks that member first every time. UPS-006 asks for failover within one query; DNS-011 refuses bogus answers. The validation library keeps the proofs it found bogus, per validating handle (one per group), for up to a minute. The owner decided on 2026-11-28: one gated retry at another member, on by default in validate and permissive, no configuration key. The rule below includes the refinements of 2026-11-28: a retry serves only a secure or insecure answer, and its memory is kept per member left out.
Decision
- When a validation ends bogus (after ADR-098's unsigned-zone proof and ADR-188's link-by-link validation), it is validated once more through the group without the member that answered the question, when: that member is known; another member's breaker is closed; the validation's deadline (two query budgets, review 03-05) leaves at least 100 ms (ADR-197's least time for a try); the question (group, type and name) wasn't bogus without that member within the last minute; and one of 8 slots is free. Otherwise the bogus verdict stands, as before.
- Each validation names the member that answered its own question: a slot local to the validation's task, which the question's answer fills (the library sends the question before the keys and proofs it needs). That member is the one the retry leaves out and the one the per-upstream DNSSEC counts (OBS-019) credit with the bogus verdict. Under
failover, the default, every lookup of a validation goes to that member; under strategies that spread lookups (round_robin, and partlyfastestandparallel), a key lookup can have gone to another member, which can be the one whose answer was bad. - Every lookup of the retry leaves out that member: the question, the DNSKEY and DS lookups the validation library makes, and the unsigned-zone proof's SOA and DS questions (
Group::resolve_without, through aGroupHandlethat leaves the member out). The retry asks the members the strategy picks among the rest, a probing or benched member as a last resort included;another_closedis only the gate. The retry has a validating handle of its own per group and member left out, so it never reads the proofs the group's own handle found bogus. Its validation cache holds 1,024 record-set proofs, an eighth of ADR-196's bound (about 1.6 MiB at most). Its unsigned-zone proofs and link walks keep their memory of failures apart from the group's, since what failed through the member left out says nothing of the others; they take the same slots. A proof or link walk of the retry that found every slot busy leaves the retry bogus, and it is remembered as below: fail-conservative. - The retry's answer replaces the bogus one only when it is secure or insecure (an insecure one with or without an answer of its own). An indeterminate retry, with or without an answer, is nothing to serve: the first verdict stands and the retry counts as
failed(a definite bogus verdict isn't overruled by an undecided one). So only answers that validate are served from a retry: validation isn't weakened. A zone the retry proves unsigned is remembered for the group, as any proven zone (ADR-098); an insecure retry without an answer of its own is then fetched without validation through the whole group, the member left out included, as every later name in that zone is: that is sound, since the zone's unsigned status comes from a validated denial of its DS, and an unsigned zone's answers can't be validated through any member. - A retry that is bogus too is remembered per member left out, for a minute: that question isn't asked again without that member until then. A retry that ends with nothing to serve (no answer in time, an indeterminate verdict, an upstream failure) isn't remembered.
- On by default, in
validateandpermissivealike: the validator doesn't know the mode (ADR-188); the retry runs before the mode is applied, so inpermissivethe client gets the other member's validated answer when it replaced the bogus one, and the bogus answer otherwise. No configuration key: the retry only replaces a bogus answer with one that validates, and the bounds below hold its cost (a key would have to be written only when it differs from its default, with an upgrade-order note, ADR-187). A group of one member never asks again. - A retried answer carries the member whose answer was bogus (
Validated::retried_from), so the per-upstream DNSSEC counts count the bogus verdict for that member and the served verdict for the member that answered. A retry that is bogus too ends with the first member's verdict, so one verdict is counted per question, for the first member. - Counted in a new family,
telltale_dnssec_retries_total{result}:served(the retry's answer replaced the bogus one),bogus(bogus there too),failed(nothing to serve: no answer in time, an indeterminate verdict, or an upstream failure).telltale_dnssec_validation_totalcounts each question once, with the verdict it ends with.
What it doesn't change: cache hits; questions whose first validation isn't bogus; the client's wait (the budget plus 100 ms) and the validation's deadline; the health of a member that gave a bogus answer (it still counts as an answer: a broken zone gives a bogus answer at every member, and counting it as a failure would let a name anyone can ask bench healthy upstreams for all traffic, since the breaker is shared with the queries that aren't validated), so failover keeps asking it first; the strategies' order among the other members.
Consequences
- With one member that strips signatures and another that doesn't, a signed name validates through the other one (issue #107's case), within the deadline. If the client's wait ends first, the answer still lands in the cache.
- A retry can make a refused answer arrive after the client's wait: the client then gets SERVFAIL with EDE 22, or an expired entry with EDE 3, in place of SERVFAIL with EDE 6; in
permissive, a bogus answer that was served at once now follows the retry. - Amplification: at most one validation more per question; per name, at most one more per member left out a minute when the retries are bogus, so a name that is bogus everywhere costs at most one validation more per member a minute (bounded by the group's size). A name whose retry always runs out of time is retried on every question, within the existing deadline. A burst of distinct bogus names makes at most 8 retries at once, each holding the in-flight permit it already held, within the same deadline.
- Memory: up to about 1.6 MiB per pair of group and member left out, for the retry handles' caches, filled only by retries. A realistic configuration has 1 to 3 groups of 2 to 4 members, so at most about 12 pairs (about 19 MiB if every pair's cache were full); after a reload the old pairs stay, each holding its old group, until the map passes 64 pairs and is cleared, as the groups' own handles are.
- The question budget's bogus shapes are asked through two members at one fake upstream; their counts gain the retry's questions, which the second member also finds bogus:
bogus-signature2 → 4,bogus-cname10 → 22 (the retry's validation cache starts cold, and its proof and link walk run again under their own memories). Every other row is unchanged (one member, nothing asked again). - Mixed versions: none (no key, no wire or API change).
Verification
offline: dns_011_offline_bogus_answer_is_asked_again_at_another_member, dns_011_offline_retry_keeps_every_lookup_off_the_first_member, dns_011_offline_bogus_at_every_member_is_not_retried_for_a_minute, dns_011_offline_retry_ends_within_the_validation_deadline (the first member slow too, so a retry with a deadline of its own would end past the bound), dns_011_offline_an_indeterminate_retry_is_not_served, dns_011_offline_the_retry_memory_is_per_member_left_out, dns_011_offline_a_cname_chain_bogus_at_one_member_is_asked_again, dns_011_offline_a_denial_bogus_at_one_member_is_asked_again, dns_011_offline_an_insecure_retry_without_an_answer_is_served, ups_005_single_member_group_is_not_retried, ups_006_a_bogus_answer_is_not_asked_again_at_a_benched_member, obs_019_bogus_verdict_is_counted_for_the_member_that_gave_it, dns_011_offline_question_budget_bogus_answers; unit: ups_006_a_member_left_out_gets_no_attempt, obs_019_a_retried_question_counts_each_members_verdict. The two-member tests start each member's latency average high, so that the group never hedges to the second member while the first answers in time. Not tested at the pipeline level: permissive and the fetch after an insecure retry without an answer (the pipeline's tests have no signed zone; the offline harness is the validator's).
REQ: DNS-011, UPS-005, UPS-006, OBS-019, NFR-004.
Requirements DNS-011 NFR-004 OBS-019 UPS-005 UPS-006
Builds on ADR-098 ADR-187 ADR-188 ADR-196 ADR-197
Referenced by ADR-202
ADR-202 DNSSEC stage timing: the query event's t_dnssec_us and telltale_stage_duration_seconds{stage="dnssec"}, event and histogram only, and an EDE 22 text that says when validation is still runningGitHub issue #112 (airart320): with recursive:// and validate, cold names three CNAMEs deep in an unsigned zone fail 3 of 3 times with SERVFAIL and EDE 22 after about 2.1 s, and the reporter asks where the time goes.
Context
GitHub issue #112 (airart320): with recursive:// and validate, cold names three CNAMEs deep in an unsigned zone fail 3 of 3 times with SERVFAIL and EDE 22 after about 2.1 s, and the reporter asks where the time goes. OBS-001 (P0) asks for "a per-stage timing breakdown" and spec/06 §1 lists t_dnssec_us; the query event had t_total_us and t_upstream_us only, and telltale_stage_duration_seconds had stage="upstream" only. A validated cold miss waits the query budget plus 100 ms (spec/02 §3.3), while its validation runs in the resolution's own task for up to two budgets and puts its answer in the cache when it ends later; the client's SERVFAIL then said "no upstream answered", which can be wrong. The owner decided on 2026-11-28: keep the client's wait as it is; don't warm the root's and top-level domains' keys at start yet (deferred until measurements exist); add the event field and the histogram, event and histogram only, and a truthful EDE 22 text. The stage is the validation's own time, not the whole validated lookup: the question's own round trip is what stage="upstream" already shows, and #112's question is whether the validation or the upstream is slow.
Decision
QueryEvent.t_dnssec_us(u32): the DNSSEC validation's own time for the query's own validated miss: from when its question's answer arrived to the return ofValidator::resolve_timed: the lookups of the keys and the proofs, a bogus answer validated again (ADR-201), and its own work. The question's round trip isn't in it (it is int_upstream_us). The validator reads the clock once when the question's answer arrives (inside the validation's task, off the cache-hit path: the first answer through a group handle,ANSWERED), and the end is the clock read that already times the upstream event of that miss (resolve_validated). It is 0 when the validator asked nothing (a name under a zone proven unsigned, an answer from validated NSEC ranges) or got no answer. The resolution's task records it in a slot local to the task (ValidationStage, two atomics, one per client miss with DNSSEC on), and the client's answer carries it into its event. It is also 0 for a cache answer, a miss that isn't validated (validation off, CD, a negative trust anchor), a query that took another query's outcome (ADR-197: it didn't validate; a query whose leader went away without one resolves, and validates, on its own, in its own task's slot, and carries its own time), and a miss whose validation hadn't finished when the client's wait ended (its upstream event, emitted when it ends, still carries the whole lookup's time).telltale_stage_duration_seconds{stage="dnssec"}: a histogram oft_dnssec_usover the client queries that were answered and carry one, built by the aggregator from the events asstage="upstream"is (ADR-031). Both are in the same buckets; the DNSSEC stage is part of the upstream stage.- Event and histogram only. The query log's storage, the API's live tail, event sinks, OTLP traces and the analytics' latency breakdown don't carry the field: storing it is a new column (a format and migration question, and a size cost on every stored query) and an API field (OpenAPI, agents), each a decision of its own once the histogram shows it is worth it. The event's in-memory ring record grows by 4 bytes (65 bytes plus the name), so a ring of the same size holds a little fewer events; nothing outside the process reads that encoding.
- EDE 22's text says "validation still running" when the client's wait ends while its miss's validation is still running (the task's slot says so), in place of "no upstream answered". The code, the SERVFAIL, the stale answer where one may be served, and the wait are unchanged. A query that took another query's outcome keeps "no upstream answered" (its own task never validated). So does a leader whose first try ended without an answer while a second try (ADR-197, for the queries that joined it) still runs: the slot moves to "running" only from "not validated", so a second try leaves the first try's "done" in place (it still records its own time when it ends).
Consequences
- A validated miss that finishes within the client's wait shows its validation's own time in the histogram; one that doesn't is seen as SERVFAIL with "validation still running", and its whole lookup's time in the upstream histograms and the upstream event. The 2.1 s of issue #112 can be told apart: the validation ran out the client's wait, or the upstream didn't answer (also with a second try running). Next to
stage="upstream", the histogram tells a slow validation from a slow upstream or recursor; names that asked the validator nothing aren't counted. - Cost: one 4-byte field encoded per query event (on every query, cache answers included: no clock read, no allocation); on a client miss that reaches the pipeline's resolution with DNSSEC on, one small allocation for the slot and a task-local scope (none with DNSSEC off, the default); on a validated miss, one clock read more (when its question's answer arrives: once per validation scope, so one more for a bogus answer validated again, ADR-201) and three atomic operations.
- Two rare edges. A client whose wait is shorter than the budget (the stale-answer wait) and that has no stale entry to get can read "validation still running" while its question is still out, since the slot says "running" from the moment the question is sent. When the question never got an answer and a rescue's proof did (the lookup-timeout branch), the stage starts at the proof's first answer instead of being 0.
- No configuration, wire, storage or API change; no mixed-version effect.
Verification
obs_001_query_event_carries_validation_time (a validated miss carries it, within its upstream time; a cache answer and a miss with CD don't), obs_001_validation_time_leaves_out_the_wait_for_the_answer (an answer 500 ms late: in the upstream time, not the validation's), obs_001_offline_validation_time_starts_when_the_answer_arrives (none when nothing is asked), obs_001_exported_stage_dnssec_counts_timed_validations (the histogram counts what carries one), obs_001_metrics_show_both_stage_series, dns_013_ede_22_says_when_validation_is_still_running (and the wait, bounded both ways), dns_013_ede_22_keeps_no_upstream_answered_when_a_second_try_runs, and dns_011_offline_cold_validation_is_cached_after_the_client_gives_up (EDE 22 after the budget plus 100 ms, then a cache answer: today's behaviour, kept); make bench-smoke (the event encodes 4 more bytes on every query).
REQ: OBS-001, OBS-005, DNS-011, DNS-013.
Requirements DNS-011 DNS-013 OBS-001 OBS-005
ADR-203 A denial the validation library judges insecure proves its zone unsigned through our own proof, which is remembered; the denial's SOA only says where the proof startsSince hickory-net 0.26.4 each denial (NXDOMAIN or NODATA) in an unsigned zone costs the validation library a walk of its own: k + 1 NS questions and one DS question more, k being the name's labels below the zone, on every validation (k + 7 questions with the keys cached, measured on 2026-11-27, pull request #106).
Context
Since hickory-net 0.26.4 each denial (NXDOMAIN or NODATA) in an unsigned zone costs the validation library a walk of its own: k + 1 NS questions and one DS question more, k being the name's labels below the zone, on every validation (k + 7 questions with the keys cached, measured on 2026-11-27, pull request #106). A second name in the same zone costs as much as the first, because nothing is remembered when the library judges a zone insecure itself: the 15-minute memory of zones proven unsigned (ADR-098, ADR-184) is filled only by our own proof, which runs after a bogus verdict, an error or a timeout. Issue #112's names sit in an unsigned zone, where every such walk is a round trip of its own. The hickory implementer's analysis (2026-11-27, "Option 2") proposed filling that memory after the library judges a denial insecure, with the zone taken only from our own proof; the owner decided on 2026-11-28 to do so, in a decision of its own.
Decision
- When the validation library's own verdict on an answer is insecure and the answer is a denial (NOERROR or NXDOMAIN with no answer records; a SERVFAIL or REFUSED a group passes on as the last answer it has is none), our unsigned-zone proof (ADR-098, ADR-184, unchanged) runs for the zone the denial is in, and a zone it proves is remembered for the group, for the proof's TTL and at most 15 minutes, as any proven zone (at most 4,096 zones). Names under it are then not validated: the pipeline fetches them without validation (one question in place of k + 7).
- The zone comes only from that proof: walking down from the top, an apex found by an SOA question and trusted only through its parent's validated denial of its DS. The denial's own SOA is a hint of where the walk ends: the owner of the closest SOA in its authority section that the question's name is at or below, with at least two labels (the walk starts at two labels, so an unsigned top-level domain is never proven, ADR-098). An SOA of another zone gives no hint, and no proof runs.
- A signed zone is never remembered: the proof remembers only a zone whose DS its parent validly denies, and passes a signed zone on its way.
- Only the library's own insecure verdict on a denial starts it: never a verdict our proofs corrected, a bogus or indeterminate one, or a positive answer (the owner's decision names denials).
- It runs within the validation's deadline, before the denial is returned, on the unsigned-zone proofs' slots (8 at once), and is kept from crowding out the proofs that rescue an answer:
- it starts only while more than half of the slots are free (4 stay free once it has one, for the rescues; checked before it takes a slot and again after);
- a zone already being walked for another denial through the same group isn't walked again meanwhile: the denial that finds it so is answered as the library judged it, and remembers nothing (so the A, AAAA and HTTPS denials a client sends together walk their zone once);
- a walk that fails, by running out of time or otherwise, is remembered for a minute per hinted zone, under keys of its own in the same bounded memory of failures as the rescues' (4,096 names; when full, the failures whose minute is over make room first, and it is cleared only when every one still holds), so a zone that can't be proven costs one failing walk a minute, and such a walk doesn't keep a rescue of the zone's apex from running.
- A zone already remembered asks nothing.
- The memory of proven zones, which denials now fill far more often than rescues did, makes room first from zones whose proof has expired; when every one of its 4,096 zones still holds, the half that expires soonest goes (before, it was cleared whenever full), so the zones proven to hold longest stay, those a rescue proved among them. Both scans run on an insert into a full memory only: tens of microseconds, bounded by the rate of proofs, never paid per miss.
What it doesn't change: positive answers; secure, bogus and indeterminate verdicts; the proof itself; the memory's size; the verdict of the denial that started it (insecure, served without AD). What it does share or change, as above: it shares the proof slots with the rescues (now with half kept for them), it makes the memory fill far more often (now pruned of expired zones first, and then of its soonest-expiring half), concurrent first denials in a zone meet (now one walk at once), and the first denial in a zone waits for the proof (within the validation's deadline).
Consequences
- The first denial in each unsigned zone waits for the proof's questions (an SOA and a DS question per level walked, usually 2); later names there ask nothing of the validator for as long as the proof holds.
- Names under a remembered zone aren't validated for up to 15 minutes: if the zone becomes signed meanwhile, its answers are served insecure until then (ADR-098's trade-off, now reached from more answers).
- Question budget (offline harness, with the keys of the root and
t.cached):insecure-zone-warm(the zone's first denial, after a positive answer there) 7 → 9;nx-v.t-depth-2,-5,-109, 12, 17 → 11, 14, 19; a new row,insecure-denial-proven, a second deep name after a denial inv.t.: 0 (12 before). Rows inu.(a top-level domain) and every other row are unchanged. The controldns_011_offline_unsigned_zone_denials_stay_insecurenow sees the names after the first denial inv.t.come back without bytes (fetched by the pipeline without validation), by design. - No configuration, wire or API change; no mixed-version effect.
- Not done: a positive answer the library judges insecure doesn't start the proof. Starting it there too would make
insecure-zone-warmask nothing, at the same cost of 2 questions for the first answer per zone; that is the owner's call.
Verification
dns_011_offline_a_second_deep_name_under_a_proven_zone_asks_nothing, dns_011_offline_a_signed_zone_is_never_remembered, dns_011_offline_an_unrelated_soa_hint_proves_nothing, dns_011_offline_insecure_denial_proof_leaves_slots_for_rescues, dns_011_offline_concurrent_first_denials_walk_their_zone_once, dns_011_offline_a_denial_proof_out_of_time_leaves_the_rescue_alone (and the first denial's wait, bounded by the deadline), dns_011_offline_a_servfail_with_an_soa_starts_no_proof, dns_011_expired_proven_zones_make_room_first, dns_011_a_full_memory_evicts_the_soonest_expiring_half, dns_011_expired_failures_make_room_first, dns_011_a_denial_proof_needs_more_than_half_the_slots_free, dns_011_denial_zone_hint_needs_a_denial_and_an_ancestor_soa, dns_011_offline_a_dropped_denial_proof_lets_the_next_walk, the question budget's dns_011_offline_question_budget_insecure_under_a_signed_tld and dns_011_offline_question_budget_unsigned_zone_denials, and dns_011_offline_unsigned_zone_denials_stay_insecure (updated as above).
REQ: DNS-011, NFR-001, NFR-004.
Requirements DNS-011 NFR-001 NFR-004
ADR-204 A reload that changes only groups' routes builds the routes again over the running upstreamsUPS-007 and OPS-009.
Context
UPS-007 and OPS-009. A reload keeps the running router when [[upstream]], [[upstream_group]], [[route]] and [[listen]] are unchanged, so the upstreams' health state, pooled connections and bootstrap cache survive (T2.7). The router also builds one route for each [[group]] that names upstreams, ordered by priority (Router::assemble), and [[group]] was not compared. So a reload (SIGHUP, an API change or a replicated version) that changed only a group's upstreams, added such a group, renamed one, or changed a priority kept the old routes until a restart or until a compared section changed. The reload-level tests showed it: after such a reload the questions still went to the old upstream group, or to default for a new or renamed group.
Decision
keep the running upstreams and build only the routes again.
- When those four sections are unchanged but the groups' routes may have changed, the reload keeps the running upstreams and upstream groups: the same handles, with their health state, pooled connections, bootstrap cache and the groups' round-robin and weighted state. Only the routes are built again from the new configuration over them (
Router::with_routes_from, which runs the same route building asRouter::assemble), and the log says so ("groups changed: the routes are built again over the running upstreams"; the rest of the reload is built after it and can still fail, which it logs). - The comparison takes every group's
name,upstreamsandpriority, in order. That is a little more than the router reads, since it builds routes only for groups withupstreams. It is kept conservative on purpose: a change to a group withoutupstreamsbuilds the same routes again, which costs one route build and changes nothing else. - When nothing the router reads from
[[group]]changed (a block mode, lists, networks, or nothing), the running router is kept as before. - When a compared section changed, the router is built anew as before.
Alternatives considered
- (a) Compare the group fields in
same_upstreams, so a change of them builds the whole router again. Simpler, but a group-only edit would then reset every upstream's health state (breakers, latency averages, the rolling window), close its pooled TCP, DoT and DoH connections (the next queries pay a new handshake), clear the bootstrap cache, and restart the active health checks. That is a cost for an edit that changed no upstream. Not chosen.
Consequences
- A group's own upstreams, a new or renamed group with own upstreams, and a priority change apply on the reload, as the docs promised ("Applied immediately ... groups").
- The upstreams' health state survives such a reload, and their
telltale_upstream_*counters go on. - Upstream IDs and names don't change, so the per-upstream histograms stay as they are.
- Nothing changes on the query path:
Router::selectandSelectionare untouched, and the routes are the same type, built on the reload path only.
Verification
reload-level tests that run the node binary with two counting stub upstreams on loopback, edit the configuration and send SIGHUP. Red before this decision:
ups_007_a_reload_that_changes_a_groups_upstreams_routes_to_the_new_ones(also: the counters of the unchanged upstream go on);ups_007_a_reload_that_adds_a_group_with_its_own_upstreams_routes_to_them;ups_007_a_reload_that_renames_a_group_keeps_its_route;ups_007_a_reload_that_changes_a_priority_moves_a_device_in_two_groups;ups_007_a_reload_that_removes_a_groups_upstreams_routes_to_default.
Each of these five also checks that the reload took the routes-only path: the log line appears once.
A guard, green before and after: ops_009_a_reload_that_keeps_the_groups_routes_keeps_the_router. A block-mode change, the change back, and a reload of the identical file keep the running router: no routes are built again (no log line), the questions go where they went, and the upstream's counters go on.
ups_007_routes_from_a_running_router_match_a_new_build (in telltale-upstream) covers seven pairs of configurations that differ only in [[group]]: a group's upstreams changed, a priority swap, a rename, an equal-priority reorder, upstreams = "default", a group added, and a group's upstreams removed. For each, with_routes_from gives the same routes as a new router of the second configuration (their Debug text). Every upstream and upstream group is the running router's own (Arc::ptr_eq), and the name index and default are the same.
REQ: UPS-007, OPS-009, UPS-006.
Requirements OPS-009 UPS-006 UPS-007
No decision matches. Try fewer words, or another status or area.