From c4855fe0ea1e2419034ab6965e0bbd11dc397c6e Mon Sep 17 00:00:00 2001 From: Ryan Petris Date: Sat, 18 Nov 2023 11:27:40 -0700 Subject: [PATCH] Fix Empty Resolver Set Config.singleResolverSet returns true if all routes have the same resolvers, even if the routes have no resolvers. If none of the routes have a specific resolver, the default should be used instead. Therefore, check for more than 0 instead of nil. Signed-off-by: Ryan Petris --- net/dns/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dns/manager.go b/net/dns/manager.go index 1b5903b59..ab94743db 100644 --- a/net/dns/manager.go +++ b/net/dns/manager.go @@ -228,7 +228,7 @@ func (m *Manager) compileConfig(cfg Config) (rcfg resolver.Config, ocfg OSConfig // This bool is used in a couple of places below to implement this // workaround. isWindows := runtime.GOOS == "windows" - if cfg.singleResolverSet() != nil && m.os.SupportsSplitDNS() && !isWindows { + if len(cfg.singleResolverSet()) > 0 && m.os.SupportsSplitDNS() && !isWindows { // Split DNS configuration requested, where all split domains // go to the same resolvers. We can let the OS do it. ocfg.Nameservers = toIPsOnly(cfg.singleResolverSet())