fix: always append IPv6 bootstrap DNS servers#25
Merged
Conversation
Commit #24 added IPv6 bootstrap nameservers for IPv6-only uplinks, but gated them behind `if config.dns.default_nameserver.is_empty()`. When a profile supplies its own `default-nameserver` (typically IPv4-only), the else branch cloned that list verbatim and the IPv6 fallback was dropped. On an IPv6-only uplink (e.g. 464XLAT cellular, interface has no IPv4 address) the IPv4 bootstrap servers are unreachable, so every bootstrap query times out, the DoT main nameservers cannot be resolved, and the resolver ends up with zero usable clients -> "no DNS clients available for query" on every connection. Always append the IPv6 bootstrap servers (with a dedup check) regardless of whether the list came from defaults or the profile, so resolution can still proceed on IPv6-only networks. Also factor the repeated NameServer literals into a small udp_bootstrap closure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
On an IPv6-only uplink (e.g. 464XLAT cellular, where the network interface has no IPv4 address), the app fails to resolve any domain — every connection logs
dns error: no DNS clients available for query.Trace from a real device log (
rmnet_data5hasv4: None, only a global IPv6 address):default_nameserver) runs with IPv4-only servers (114.114.114.114,8.8.8.8) → both unreachable → every bootstrap query times out.dns.alidns.com:853,dot.pub:853) can't be resolved →initializing DNS client ... with error dns error: request timed out.all components initialized, but with zero usable DNS clients →no DNS clients available for queryon every subsequent connection.Why #24 didn't cover this
#24 added IPv6 bootstrap servers, but only inside the
if config.dns.default_nameserver.is_empty()branch. This device's profile supplies its owndefault-nameserver(the IPv4-only114.114.114.114value — not present anywhere in our code — confirms it), so it took theelsebranch and the IPv6 fallback was silently dropped.Change
2400:3200::1/2400:3200:baba::1, Google2001:4860:4860::8888) todefault_nameserver, whether the list came from the built-in defaults or from the profile. A dedup check (url::HostderivesPartialEq) avoids duplicates.NameServer { … }literals into a smalludp_bootstrapclosure.Reviewer notes
Hostisurl::Host(derivesPartialEq); the closure borrow in.any()ends before thepushmove.dns.alidns.com:853initializes successfully.nameserver(the main resolvers, not bootstrap) would still fail on IPv6-only. Not the case here (the main resolvers are DoT domains, which resolve fine once bootstrap works).🤖 Generated with Claude Code