queryServers always tries servers in fixed order, so every resolution starts at a.root-servers.net #138
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raised as a question rather than filed as a defect, because it may be a deliberate simplicity choice. @sneak — a one-word answer settles it.
Observation
internal/resolver/iterative.go—rootServerList()returns the thirteen roots in a fixed order beginning198.41.0.4(a.root-servers.net), andqueryServerswalks that slice strictly in order, returning on the first success:Because the happy path succeeds on the first entry, every iterative resolution dnswatcher performs begins by querying
a.root-servers.net, and the other twelve roots are contacted only when it fails. The remaining twelve are, in practice, a failover list rather than a pool.Two consequences:
DNSWATCHER_DNS_INTERVAL, this points all root traffic at one operator.a.root-servers.netis slow or unreachable from the host, every single resolution pays that timeout before failing over, rather than one-in-thirteen of them.This surfaced while investigating the test flakiness in #93: with ~35 parallel tests on a 48-core machine, every test fired its first query at the same IP within milliseconds of the others, which fits the observed "a different subset fails each run" signature. That issue was scoped test-side and fixed test-side, so this production behaviour was deliberately left untouched.
Note
queryServersis shared — it is also used for the per-domain nameserver lists, not only the roots — so any change affects both call sites.The question
Is the fixed order intentional (deterministic, simple, easy to reason about) or incidental? If incidental, the fix is small: shuffle the list per resolution, or track per-server RTT and prefer the fastest.
If you want it changed, say so and this becomes a normal work unit with the definition of done below. If it is deliberate, say so and I will close this.
Definition of done, if you want it fixed
make checkgreen.