mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
ipn/ipnlocal: print warning about DNS servers in bugreport --diagnose
If the user passes the --diagnose flag, print a warning if any of the default or fallback DNS resolvers are Tailscale IPs. This can interfere with the ability to connect to the controlplane, and is typically something to pay attention to if there's a connectivity issue. Change-Id: Ib14bf6228c037877fbdcd22b069212b1a4b2c456 Signed-off-by: Andrew Dunham <andrew@tailscale.com>
This commit is contained in:
parent
c4eb857405
commit
5ba2543828
@ -4626,6 +4626,32 @@ func (b *LocalBackend) Doctor(ctx context.Context, logf logger.Logf) {
|
||||
var checks []doctor.Check
|
||||
checks = append(checks, routetable.Check{})
|
||||
|
||||
// Print a log message if any of the global DNS resolvers are Tailscale
|
||||
// IPs; this can interfere with our ability to connect to the Tailscale
|
||||
// controlplane.
|
||||
checks = append(checks, doctor.CheckFunc("dns-resolvers", func(_ context.Context, logf logger.Logf) error {
|
||||
b.mu.Lock()
|
||||
nm := b.netMap
|
||||
b.mu.Unlock()
|
||||
if nm == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
for i, resolver := range nm.DNS.Resolvers {
|
||||
ipp, ok := resolver.IPPort()
|
||||
if ok && tsaddr.IsTailscaleIP(ipp.Addr()) {
|
||||
logf("resolver %d is a Tailscale address: %v", i, resolver)
|
||||
}
|
||||
}
|
||||
for i, resolver := range nm.DNS.FallbackResolvers {
|
||||
ipp, ok := resolver.IPPort()
|
||||
if ok && tsaddr.IsTailscaleIP(ipp.Addr()) {
|
||||
logf("fallback resolver %d is a Tailscale address: %v", i, resolver)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}))
|
||||
|
||||
// TODO(andrew): more
|
||||
|
||||
numChecks := len(checks)
|
||||
|
Loading…
x
Reference in New Issue
Block a user