Pull request: 3371 pipe-tailed rules

Merge in DNS/adguard-home from 3371-rules-validation to master

Updates #3371.

Squashed commit of the following:

commit 7881a0bc788f130eaed27ea9306309dea52f62e7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Thu Nov 11 15:06:42 2021 +0300

    all: imp code, docs

commit 613775a4bc3e75ca7792fb6896e161f3ef6b1a29
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date:   Tue Nov 2 16:50:43 2021 +0300

    all: upd urlfilter
This commit is contained in:
Eugene Burkov
2021-11-11 16:19:33 +03:00
parent 6fd9e72fbb
commit 884a98501d
7 changed files with 63 additions and 37 deletions

View File

@@ -341,14 +341,12 @@ func (s *Server) processRestrictLocal(ctx *dnsContext) (rc resultCode) {
// Restrict an access to local addresses for external clients. We also
// assume that all the DHCP leases we give are locally-served or at
// least don't need to be inaccessible externally.
if s.subnetDetector.IsLocallyServedNetwork(ip) {
if !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
d.Res = s.genNXDomain(req)
if s.subnetDetector.IsLocallyServedNetwork(ip) && !ctx.isLocalClient {
log.Debug("dns: %q requests for internal ip", d.Addr)
d.Res = s.genNXDomain(req)
// Do not even put into query log.
return resultCodeFinish
}
// Do not even put into query log.
return resultCodeFinish
}
// Do not perform unreversing ever again.