Added refuseany (enabled by default)
Added ratelimit and refuseany to the config file (for manual editing only)
This commit is contained in:
Andrey Meshkov
2018-11-26 13:38:17 +03:00
parent a6c9210461
commit a0482fc201
3 changed files with 8 additions and 3 deletions

View File

@@ -68,6 +68,8 @@ type coreDNSConfig struct {
ParentalSensitivity int `yaml:"parental_sensitivity"`
BlockedResponseTTL int `yaml:"blocked_response_ttl"`
QueryLogEnabled bool `yaml:"querylog_enabled"`
Ratelimit int `yaml:"-"`
RefuseAny bool `yaml:"-"`
Pprof string `yaml:"-"`
Cache string `yaml:"-"`
Prometheus string `yaml:"-"`
@@ -102,6 +104,8 @@ var config = configuration{
SafeBrowsingEnabled: false,
BlockedResponseTTL: 10, // in seconds
QueryLogEnabled: true,
Ratelimit: 20,
RefuseAny: true,
BootstrapDNS: "8.8.8.8:53",
UpstreamDNS: defaultDNS,
Cache: "cache",
@@ -253,7 +257,8 @@ const coreDNSConfigTemplate = `.:{{.Port}} {
{{end}}
}{{end}}
{{.Pprof}}
ratelimit
{{if .RefuseAny}}refuseany{{end}}
{{if gt .Ratelimit 0}}ratelimit {{.Ratelimit}}{{end}}
hosts {
fallthrough
}