diff --git a/config.go b/config.go index f79c4684..f9907feb 100644 --- a/config.go +++ b/config.go @@ -68,10 +68,9 @@ var config = configuration{ binaryFile: "coredns", // only filename, no path coreFile: "Corefile", // only filename, no path FilteringConfig: dnsforward.FilteringConfig{ - ProtectionEnabled: true, - FilteringEnabled: true, - SafeBrowsingEnabled: false, - BlockedResponseTTL: 10, // in seconds + ProtectionEnabled: true, // whether or not use any of dnsfilter features + FilteringEnabled: true, // whether or not use filter lists + BlockedResponseTTL: 10, // in seconds }, QueryLogEnabled: true, Ratelimit: 20, diff --git a/coredns.go b/coredns.go index 05199868..f6940abe 100644 --- a/coredns.go +++ b/coredns.go @@ -31,9 +31,9 @@ func generateServerConfig() dnsforward.ServerConfig { } newconfig := dnsforward.ServerConfig{ - UDPListenAddr: &net.UDPAddr{Port: config.CoreDNS.Port}, - BlockedResponseTTL: config.CoreDNS.BlockedResponseTTL, - Filters: filters, + UDPListenAddr: &net.UDPAddr{Port: config.CoreDNS.Port}, + FilteringConfig: config.CoreDNS.FilteringConfig, + Filters: filters, } for _, u := range config.CoreDNS.UpstreamDNS { diff --git a/dnsforward/dnsforward.go b/dnsforward/dnsforward.go index 7a2716e9..bf7566a9 100644 --- a/dnsforward/dnsforward.go +++ b/dnsforward/dnsforward.go @@ -74,28 +74,25 @@ func (s *Server) RUnlock() { */ type FilteringConfig struct { - ProtectionEnabled bool `yaml:"protection_enabled"` - FilteringEnabled bool `yaml:"filtering_enabled"` - SafeBrowsingEnabled bool `yaml:"safebrowsing_enabled"` - SafeSearchEnabled bool `yaml:"safesearch_enabled"` - ParentalEnabled bool `yaml:"parental_enabled"` - ParentalSensitivity int `yaml:"parental_sensitivity"` - BlockedResponseTTL uint32 `yaml:"blocked_response_ttl"` + ProtectionEnabled bool `yaml:"protection_enabled"` + FilteringEnabled bool `yaml:"filtering_enabled"` + BlockedResponseTTL uint32 `yaml:"blocked_response_ttl"` // if 0, then default is used (3600) + + dnsfilter.Config `yaml:",inline"` } // The zero ServerConfig is empty and ready for use. type ServerConfig struct { - UDPListenAddr *net.UDPAddr // if nil, then default is is used (port 53 on *) - BlockedResponseTTL uint32 // if 0, then default is used (3600) - Upstreams []Upstream - Filters []dnsfilter.Filter + UDPListenAddr *net.UDPAddr // if nil, then default is is used (port 53 on *) + Upstreams []Upstream + Filters []dnsfilter.Filter FilteringConfig } var defaultValues = ServerConfig{ - UDPListenAddr: &net.UDPAddr{Port: 53}, - BlockedResponseTTL: 3600, + UDPListenAddr: &net.UDPAddr{Port: 53}, + FilteringConfig: FilteringConfig{BlockedResponseTTL: 3600}, Upstreams: []Upstream{ //// dns over HTTPS // &dnsOverHTTPS{Address: "https://1.1.1.1/dns-query"},