Pull request: all: allow local non-top-level domains

Updates #2961.

Squashed commit of the following:

commit 207eeb85caf6caee81a669302daf4e10a5b61585
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 15 18:48:50 2021 +0300

    all: allow local non-top-level domains
This commit is contained in:
Ainar Garipov
2021-04-15 19:00:31 +03:00
parent a1450c5595
commit d83091fc1f
11 changed files with 128 additions and 54 deletions

View File

@@ -422,9 +422,9 @@ func (d *DNSFilter) CheckHost(
return Result{}, nil
}
// checkAutoHosts compares the host against our autohosts table. The err is
// checkEtcHosts compares the host against our /etc/hosts table. The err is
// always nil, it is only there to make this a valid hostChecker function.
func (d *DNSFilter) checkAutoHosts(
func (d *DNSFilter) checkEtcHosts(
host string,
qtype uint16,
_ *FilteringSettings,
@@ -829,8 +829,8 @@ func New(c *Config, blockFilters []Filter) *DNSFilter {
}
d.hostCheckers = []hostChecker{{
check: d.checkAutoHosts,
name: "autohosts",
check: d.checkEtcHosts,
name: "etchosts",
}, {
check: d.matchHost,
name: "filtering",