-(dnsfilter): match DNS response against filtering rules only

Supposedly, this will fix #1290
This commit is contained in:
Andrey Meshkov
2019-12-23 15:59:49 +03:00
parent 7c0cf641db
commit b4f4111609
2 changed files with 14 additions and 4 deletions

View File

@@ -263,7 +263,17 @@ func (r Reason) Matched() bool {
return r != NotFilteredNotFound
}
// CheckHost tries to match host against rules, then safebrowsing and parental if they are enabled
// CheckHostRules tries to match the host against filtering rules only
func (d *Dnsfilter) CheckHostRules(host string, qtype uint16, setts *RequestFilteringSettings) (Result, error) {
if !setts.FilteringEnabled {
return Result{}, nil
}
return d.matchHost(host, qtype)
}
// CheckHost tries to match the host against filtering rules,
// then safebrowsing and parental if they are enabled
func (d *Dnsfilter) CheckHost(host string, qtype uint16, setts *RequestFilteringSettings) (Result, error) {
// sometimes DNS clients will try to resolve ".", which is a request to get root servers
if host == "" {