dns: add scoped nameservers.use_with_exit_node selectors - #3376
Open
NelsonJeppesen wants to merge 5 commits into
Open
dns: add scoped nameservers.use_with_exit_node selectors#3376NelsonJeppesen wants to merge 5 commits into
NelsonJeppesen wants to merge 5 commits into
Conversation
Add a per-nameserver list that marks the listed resolvers with Tailscale's dnstype.Resolver.UseWithExitNode flag, so those resolvers keep being used when a client selects an exit node instead of having all DNS delegated to the exit node. This lets a self-hosted resolver on the tailnet be reached directly. The flag requires client capability version 125 (Tailscale v1.88); older clients ignore it. Default is empty, preserving current behaviour. Fixes juanfont#2816
Add TestExitNodeUseWithExitNodeDNS: with an exit node selected, a resolver listed in dns.nameservers.use_with_exit_node keeps its UseWithExitNode flag in the client netmap, while an unlisted resolver does not. Register it in the SQLite CI matrix via the workflow generator. The client feature needs Tailscale v1.88+, so the scenario pins the head version.
Assert a listed split-domain resolver keeps UseWithExitNode while an unlisted split resolver in another domain does not, matching the client's per-resolver useWithExitNodeRoutes filtering.
NelsonJeppesen
force-pushed
the
dns-use-with-exit-node
branch
from
July 9, 2026 19:59
82db786 to
96c49fe
Compare
NelsonJeppesen
marked this pull request as ready for review
July 31, 2026 01:59
NelsonJeppesen
requested review from
juanfont,
kradalby,
nblock and
ohdearaugustin
as code owners
July 31, 2026 01:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2816
What
Add scoped
dns.nameservers.use_with_exit_nodeselectors for global and split DNS resolvers:Selected resolvers are sent with Tailscale
dnstype.Resolver.UseWithExitNode, so supported clients keep using them after selecting an exit node.Compatibility
globalandsplitis unchanged.Nameservers.GlobalandNameservers.SplitGo fields retain their existing types.dns.override_local_dns: true; split selectors do not.Why
By default, a Tailscale client delegates DNS to the selected exit node. That can add an unnecessary round trip for a resolver reachable through a tailnet or subnet route. This option preserves selected global or split resolvers while normal routing still determines how resolver traffic travels.
Testing
TestExitNodeUseWithExitNodeDNSuses Tailscale 1.98, activates an exit node, performs a realtailscale dns query --json, and asserts both the effective direct resolver and returned DNS answer.go test ./hscontrol/types ./integrationgo vet ./...golangci-lint run --new-from-rev=048308511c72fa77da103e932f9b857a6e5247b9 --timeout=5mnix flake check --no-buildLocal Docker execution was unavailable:
go run ./cmd/hi doctorreported that no Docker daemon was running. The integration scenario is registered in CI. A repository-widego test ./...run timed out after 10 minutes in existingTestLogoutReloginWithPollChurn; that test passed alone in 64 seconds, and all changed packages passed.