coredns plugin -- fix SHOULD NOT HAPPEN spam when incoming request is for root servers

This commit is contained in:
Eugene Bujak
2018-10-05 07:31:56 +03:00
parent 5b9a5fff97
commit 3a7a80f15f
2 changed files with 11 additions and 4 deletions

View File

@@ -148,9 +148,9 @@ func (r Reason) Matched() bool {
// CheckHost tries to match host against rules, then safebrowsing and parental if they are enabled
func (d *Dnsfilter) CheckHost(host string) (Result, error) {
// sometimes DNS clients will try to resolve ".", which in turns transforms into "" when it reaches here
// sometimes DNS clients will try to resolve ".", which is a request to get root servers
if host == "" {
return Result{Reason: FilteredInvalid}, nil
return Result{Reason: NotFilteredNotFound}, nil
}
host = strings.ToLower(host)