Skip to content

Commit cc0b809

Browse files
committed
Disable fallback DNS resolver
1 parent 5b18a9c commit cc0b809

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

control/controlclient/direct.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"github.com/sagernet/tailscale/ipn/ipnstate"
3434
"github.com/sagernet/tailscale/logtail"
3535
"github.com/sagernet/tailscale/net/dnscache"
36-
"github.com/sagernet/tailscale/net/dnsfallback"
3736
"github.com/sagernet/tailscale/net/netmon"
3837
"github.com/sagernet/tailscale/net/netutil"
3938
"github.com/sagernet/tailscale/net/tlsdial"
@@ -249,11 +248,11 @@ func NewDirect(opts Options) (*Direct, error) {
249248
}
250249

251250
dnsCache := &dnscache.Resolver{
252-
Forward: dnscache.Get().Forward, // use default cache's forwarder
253-
UseLastGood: true,
254-
LookupIPFallback: dnsfallback.MakeLookupFunc(opts.Logf, netMon),
255-
Logf: opts.Logf,
256-
LookupHook: opts.LookupHook,
251+
Forward: dnscache.Get().Forward, // use default cache's forwarder
252+
UseLastGood: true,
253+
//LookupIPFallback: dnsfallback.MakeLookupFunc(opts.Logf, netMon),
254+
Logf: opts.Logf,
255+
LookupHook: opts.LookupHook,
257256
}
258257

259258
httpc := opts.HTTPTestClient

control/controlhttp/client.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import (
4242
"github.com/sagernet/tailscale/envknob"
4343
"github.com/sagernet/tailscale/health"
4444
"github.com/sagernet/tailscale/net/dnscache"
45-
"github.com/sagernet/tailscale/net/dnsfallback"
4645
"github.com/sagernet/tailscale/net/netutil"
4746
"github.com/sagernet/tailscale/net/sockstats"
4847
"github.com/sagernet/tailscale/net/tlsdial"
@@ -430,10 +429,10 @@ func (a *Dialer) resolver() *dnscache.Resolver {
430429
}
431430

432431
return &dnscache.Resolver{
433-
Forward: dnscache.Get().Forward,
434-
LookupIPFallback: dnsfallback.MakeLookupFunc(a.logf, a.NetMon),
435-
UseLastGood: true,
436-
Logf: a.Logf, // not a.logf method; we want to propagate nil-ness
432+
Forward: dnscache.Get().Forward,
433+
//LookupIPFallback: dnsfallback.MakeLookupFunc(a.logf, a.NetMon),
434+
UseLastGood: true,
435+
Logf: a.Logf, // not a.logf method; we want to propagate nil-ness
437436
}
438437
}
439438

logpolicy/logpolicy.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
"github.com/sagernet/tailscale/logtail"
3838
"github.com/sagernet/tailscale/logtail/filch"
3939
"github.com/sagernet/tailscale/net/dnscache"
40-
"github.com/sagernet/tailscale/net/dnsfallback"
4140
"github.com/sagernet/tailscale/net/netknob"
4241
"github.com/sagernet/tailscale/net/netmon"
4342
"github.com/sagernet/tailscale/net/netns"
@@ -798,9 +797,9 @@ func dialContext(ctx context.Context, netw, addr string, netMon *netmon.Monitor,
798797
// If we failed to dial, try again with bootstrap DNS.
799798
logf("logtail: dial %q failed: %v (in %v), trying bootstrap...", addr, err, d)
800799
dnsCache := &dnscache.Resolver{
801-
Forward: dnscache.Get().Forward, // use default cache's forwarder
802-
UseLastGood: true,
803-
LookupIPFallback: dnsfallback.MakeLookupFunc(logf, netMon),
800+
Forward: dnscache.Get().Forward, // use default cache's forwarder
801+
UseLastGood: true,
802+
//LookupIPFallback: dnsfallback.MakeLookupFunc(logf, netMon),
804803
}
805804
dialer := dnscache.Dialer(nd.DialContext, dnsCache)
806805
c, err = dialer(ctx, netw, addr)

0 commit comments

Comments
 (0)