diff --git a/dnscrypt-proxy/config.go b/dnscrypt-proxy/config.go index d9d9fdee..05b2548d 100644 --- a/dnscrypt-proxy/config.go +++ b/dnscrypt-proxy/config.go @@ -25,6 +25,7 @@ type Config struct { LogFile *string `toml:"log_file"` UseSyslog bool `toml:"use_syslog"` ServerNames []string `toml:"server_names"` + DisabledServerNames []string `toml:"disabled_server_names"` ListenAddresses []string `toml:"listen_addresses"` Daemonize bool UserName string `toml:"user_name"` @@ -399,6 +400,7 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error { if *listAll { config.ServerNames = nil + config.DisabledServerNames = nil config.SourceRequireDNSSEC = false config.SourceRequireNoFilter = false config.SourceRequireNoLog = false @@ -552,6 +554,9 @@ func (config *Config) loadSource(proxy *Proxy, requiredProps stamps.ServerInform } else if registeredServer.stamp.Props&requiredProps != requiredProps { continue } + if includesName(config.DisabledServerNames, registeredServer.name) { + continue + } if config.SourceIPv4 || config.SourceIPv6 { isIPv4, isIPv6 := true, false if registeredServer.stamp.Proto == stamps.StampProtoTypeDoH { diff --git a/dnscrypt-proxy/example-dnscrypt-proxy.toml b/dnscrypt-proxy/example-dnscrypt-proxy.toml index 926436c0..10520725 100644 --- a/dnscrypt-proxy/example-dnscrypt-proxy.toml +++ b/dnscrypt-proxy/example-dnscrypt-proxy.toml @@ -30,6 +30,11 @@ # server_names = ['scaleway-fr', 'google', 'yandex', 'cloudflare'] +## Server names to avoid even if they match all criteria. + +# disabled_server_names = [] + + ## List of local addresses and ports to listen to. Can be IPv4 and/or IPv6. ## Note: When using systemd socket activation, choose an empty set (i.e. [] ).