From 9dcd37093d641358755152bee153b6991e7f439e Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 17 Jan 2018 21:41:36 +0100 Subject: [PATCH] Use all resolvers simultaneously, even the ones from remote sources. Fireworks! --- dnscrypt-proxy/config.go | 12 ++++++------ dnscrypt-proxy/dnscrypt-proxy.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dnscrypt-proxy/config.go b/dnscrypt-proxy/config.go index c04b1bff..9df0b044 100644 --- a/dnscrypt-proxy/config.go +++ b/dnscrypt-proxy/config.go @@ -125,11 +125,6 @@ func ConfigLoad(proxy *Proxy, svcFlag *string, config_file string) error { proxy.blockNameLogFile = config.BlockName.LogFile proxy.forwardFile = config.ForwardFile - if len(config.ServerNames) == 0 { - for serverName := range config.ServersConfig { - config.ServerNames = append(config.ServerNames, serverName) - } - } for sourceName, source := range config.SourcesConfig { if source.URL == "" { return fmt.Errorf("Missing URL for source [%s]", sourceName) @@ -157,13 +152,18 @@ func ConfigLoad(proxy *Proxy, svcFlag *string, config_file string) error { continue } for _, registeredServer := range registeredServers { - if !includesName(config.ServerNames, registeredServer.name) { + if len(config.ServerNames) > 0 && !includesName(config.ServerNames, registeredServer.name) { continue } dlog.Infof("Adding [%s] to the set of wanted resolvers", registeredServer.name) proxy.registeredServers = append(proxy.registeredServers, registeredServer) } } + if len(config.ServerNames) == 0 { + for serverName := range config.ServersConfig { + config.ServerNames = append(config.ServerNames, serverName) + } + } for _, serverName := range config.ServerNames { serverConfig, ok := config.ServersConfig[serverName] if !ok { diff --git a/dnscrypt-proxy/dnscrypt-proxy.toml b/dnscrypt-proxy/dnscrypt-proxy.toml index 75069666..bb3e91dc 100644 --- a/dnscrypt-proxy/dnscrypt-proxy.toml +++ b/dnscrypt-proxy/dnscrypt-proxy.toml @@ -14,7 +14,7 @@ ## List of servers to use ## If this line is commented, all registered servers will be used -server_names = ["dnscrypt.org-fr"] +# server_names = ["dnscrypt.org-fr"] ## List of local addresses and ports to listen to. Can be IPv4 and/or IPv6.