diff --git a/go.mod b/go.mod index 64c4923d646..00aee1650a3 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/AdguardTeam/AdGuardHome go 1.17 require ( - github.com/AdguardTeam/dnsproxy v0.40.6 + github.com/AdguardTeam/dnsproxy v0.41.0 github.com/AdguardTeam/golibs v0.10.4 github.com/AdguardTeam/urlfilter v0.15.2 github.com/NYTimes/gziphandler v1.1.1 diff --git a/go.sum b/go.sum index b1a82f122d9..d2abef6a9b3 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,8 @@ dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBr dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/AdguardTeam/dnsproxy v0.40.6 h1:cTyzjiDrTk4vOXixLsWZ4Xjpqy6pqjTY++Tndq3bEf4= -github.com/AdguardTeam/dnsproxy v0.40.6/go.mod h1:PZ9l22h3Er+5mxFQB7oHZMTvx+aa9R6LbzA/ikXQlS0= +github.com/AdguardTeam/dnsproxy v0.41.0 h1:DZlzFEzDV/eKJz8b+dYctAYPrQscdsvbtBc/eFU+e9U= +github.com/AdguardTeam/dnsproxy v0.41.0/go.mod h1:PZ9l22h3Er+5mxFQB7oHZMTvx+aa9R6LbzA/ikXQlS0= github.com/AdguardTeam/golibs v0.4.0/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= github.com/AdguardTeam/golibs v0.4.2/go.mod h1:skKsDKIBB7kkFflLJBpfGX+G8QFTx0WKUzB6TIgtUj4= github.com/AdguardTeam/golibs v0.10.3/go.mod h1:rSfQRGHIdgfxriDDNgNJ7HmE5zRoURq8R+VdR81Zuzw= diff --git a/internal/dnsforward/config.go b/internal/dnsforward/config.go index 0c1ca017137..1678f18a187 100644 --- a/internal/dnsforward/config.go +++ b/internal/dnsforward/config.go @@ -243,15 +243,15 @@ func (s *Server) createProxyConfig() (proxy.Config, error) { proxyConfig.FastestPingTimeout = s.conf.FastestTimeout.Duration } - if len(s.conf.BogusNXDomain) > 0 { - for _, s := range s.conf.BogusNXDomain { - ip := net.ParseIP(s) - if ip == nil { - log.Error("Invalid bogus IP: %s", s) - } else { - proxyConfig.BogusNXDomain = append(proxyConfig.BogusNXDomain, ip) - } + for i, s := range s.conf.BogusNXDomain { + subnet, err := netutil.ParseSubnet(s) + if err != nil { + log.Error("subnet at index %d: %s", i, err) + + continue } + + proxyConfig.BogusNXDomain = append(proxyConfig.BogusNXDomain, subnet) } // TLS settings diff --git a/internal/querylog/qlog_test.go b/internal/querylog/qlog_test.go index 4e6b76b6a83..fbfc459d2ab 100644 --- a/internal/querylog/qlog_test.go +++ b/internal/querylog/qlog_test.go @@ -306,7 +306,7 @@ func assertLogEntry(t *testing.T, entry *logEntry, host string, answer, client n require.NoError(t, msg.Unpack(entry.Answer)) require.Len(t, msg.Answer, 1) - ip := proxyutil.GetIPFromDNSRecord(msg.Answer[0]).To16() + ip := proxyutil.IPFromRR(msg.Answer[0]).To16() assert.Equal(t, answer, ip) }