You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/net
Jonathan Nobels 27033c6277
net/dns: recheck DNS config on SERVFAIL errors (#12547)
Fixes tailscale/corp#20677

Replaces the original attempt to rectify this (by injecting a netMon
event) which was both heavy handed, and missed cases where the
netMon event was "minor".

On apple platforms, the fetching the interface's nameservers can
and does return an empty list in certain situations.   Apple's API
in particular is very limiting here.  The header hints at notifications
for dns changes which would let us react ahead of time, but it's all
private APIs.

To avoid remaining in the state where we end up with no
nameservers but we absolutely need them, we'll react
to a lack of upstream nameservers by attempting to re-query
the OS.

We'll rate limit this to space out the attempts.   It seems relatively
harmless to attempt a reconfig every 5 seconds (triggered
by an incoming query) if the network is in this broken state.

Missing nameservers might possibly be a persistent condition
(vs a transient error), but that would  also imply that something
out of our control is badly misconfigured.

Tested by randomly returning [] for the nameservers.   When switching
between Wifi networks, or cell->wifi, this will randomly trigger
the bug, and we appear to reliably heal the DNS state.

Signed-off-by: Jonathan Nobels <jonathan@tailscale.com>
1 year ago
..
art all: use Go 1.22 range-over-int 2 years ago
connstats all: use Go 1.22 range-over-int 2 years ago
dns net/dns: recheck DNS config on SERVFAIL errors (#12547) 1 year ago
dnscache net/dnscache: use parent context to perform lookup 2 years ago
dnsfallback tsd, ipnlocal, etc: add tsd.System.HealthTracker, start some plumbing 2 years ago
flowtrack net/flowtrack: fix, test String method 1 year ago
ipset net/ipset: skip the loop over Prefixes when there's only one 2 years ago
ktimeout net/ktimeout: add a package to set TCP user timeout 2 years ago
memnet net/memnet: export the network name (#9111) 2 years ago
netaddr all: update copyright and license headers 3 years ago
netcheck net/netcheck: fix probeProto.String result for IPv6 probes 2 years ago
neterror net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 3 years ago
netkernelconf ipn/{ipnlocal,localapi},net/netkernelconf,client/tailscale,cmd/containerboot: optionally enable UDP GRO forwarding for containers (#12410) 2 years ago
netknob all: update copyright and license headers 3 years ago
netmon net/netmon: remove spammy log statements (#11953) 2 years ago
netns net/netns: add Windows support for bind-to-interface-by-route 1 year ago
netstat net/{netns,netstat}: use new x/sys/cpu.IsBigEndian 3 years ago
netutil net/netmon, add: add netmon.State type alias of interfaces.State 2 years ago
packet net/flowtrack: optimize Tuple type for use as map key 1 year ago
ping net/ping: fix ICMP echo code field to 0 2 years ago
portmapper all: use math/rand/v2 more 2 years ago
proxymux all: cleanup unused code, part 1 (#10661) 2 years ago
routetable net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
socks5 net/socks5: add password auth support 3 years ago
sockstats net/{interfaces,netmon}, all: merge net/interfaces package into net/netmon 2 years ago
speedtest all: update copyright and license headers 3 years ago
stun derp/xdp,cmd/xdpderper: initial skeleton (#12390) 2 years ago
stunserver all: use Go 1.22 range-over-int 2 years ago
tcpinfo all: use Go 1.22 range-over-int 2 years ago
tlsdial tsd, ipnlocal, etc: add tsd.System.HealthTracker, start some plumbing 2 years ago
tsaddr net/ipset, wgengine/filter/filtertype: add split-out packages 2 years ago
tsdial tsnet,wgengine/netstack: add ListenPacket and tests 2 years ago
tshttpproxy all: use Go 1.22 range-over-int 2 years ago
tstun wgengine/filter: support FilterRules matching on srcIP node caps [capver 100] 1 year ago
wsconn net/wsconn: accept a remote addr string and plumb it through 2 years ago