plans: the resolver asks whoever it meets first, and the picker that would choose is dead code #2153

Merged
jaylouisw merged 1 commit from plan/1119-1237 into main 2026-11-19 13:11:44 +00:00
Owner

Forward plan only, no code. Measured on 2eeb3051 with three labs built on Topology/Simulator.

Findings

  1. ip name-server order is ignored: a client listing 10.9.0.2 then 10.9.0.5 was answered by 10.9.0.5, because resolveName() scans topo.devices.values() (simulator.js:294-305).
  2. A DNS server on an isolated segment, with no path from the client, still answered ok: true.
  3. With apexes lab and sub.lab on one box, www.sub.lab was answered from lab (10.0.0.30) although sub.lab is authoritative (10.0.0.31) — zones are consulted in config order.
  4. planQuery() (dns.js:532-557) and the step-driven answer cache (dns.js:446-492) are exported, unit-tested, and called by nothing but their own tests.
  5. docs/SIMULATION.md:420-421 cite simulator.js:137, :228-260, :137-156; resolveName is at :292-370.

Seven steps: docs pointers/broadcast claim (S), bestZone() longest-apex in dns.js (S), use planQuery + bestZone in the resolver (M), reachability filter (M), wire the cache on topo so API requests share it (M), show ip dns cache / clear ip dns cache (S, needs Jay's approval), docs §5.7 to Modelled (S).

Closes no open issue: the queue is #2146 (refusal advice, #2147/#2151 in flight) and #130 (device request). New suite test/dns-selection.test.js reproduces all three probes.

Forward plan only, no code. Measured on `2eeb3051` with three labs built on `Topology`/`Simulator`. **Findings** 1. `ip name-server` order is ignored: a client listing 10.9.0.2 then 10.9.0.5 was answered by 10.9.0.5, because `resolveName()` scans `topo.devices.values()` (simulator.js:294-305). 2. A DNS server on an isolated segment, with no path from the client, still answered `ok: true`. 3. With apexes `lab` and `sub.lab` on one box, `www.sub.lab` was answered from `lab` (10.0.0.30) although `sub.lab` is authoritative (10.0.0.31) — zones are consulted in config order. 4. `planQuery()` (dns.js:532-557) and the step-driven answer cache (dns.js:446-492) are exported, unit-tested, and called by nothing but their own tests. 5. docs/SIMULATION.md:420-421 cite `simulator.js:137`, `:228-260`, `:137-156`; `resolveName` is at `:292-370`. **Seven steps**: docs pointers/broadcast claim (S), `bestZone()` longest-apex in dns.js (S), use planQuery + bestZone in the resolver (M), reachability filter (M), wire the cache on `topo` so API requests share it (M), `show ip dns cache` / `clear ip dns cache` (S, needs Jay's approval), docs §5.7 to Modelled (S). Closes no open issue: the queue is #2146 (refusal advice, #2147/#2151 in flight) and #130 (device request). New suite `test/dns-selection.test.js` reproduces all three probes.
plans: the resolver asks whoever it meets first, and the picker is dead code
All checks were successful
CI / Classify the change (pull_request) Successful in 7s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 9s
CI / Test (Node 20) (pull_request) Successful in 55s
CI / Test (Node 18) (pull_request) Successful in 59s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Server smoke test (pull_request) Successful in 7s
CI / Docker build (pull_request) Successful in 15s
CI / Arm auto-merge (pull_request) Successful in 3s
14da469c21
resolveName() picks a zone in config order and a server in topology order, so a configured
primary is never preferred, an unreachable server answers, and an apex can answer for a child
zone. planQuery() and the step-driven answer cache exist, are tested, and nothing calls them.
Measured on 2eeb3051 with three labs.
forgejo-actions scheduled this pull request to auto merge when all checks succeed 2026-11-19 12:44:52 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!2153
No description provided.