* DNS: set default blocking mode to Null IP for A/AAAA, empty response for others

Close #1914

Squashed commit of the following:

commit cb127a9a409b2f228848fb838535f3db6e9d32a9
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Oct 2 12:37:11 2020 +0300

    return empty response if not A/AAAA qtype

commit 175a736d7d69619022db92a9250c382ad7fc9996
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Oct 2 12:21:51 2020 +0300

    fix

commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Oct 2 12:18:11 2020 +0300

    fix tests

commit 4225d511df910aae2df4651231c01a8a13bb937f
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Fri Oct 2 12:02:11 2020 +0300

    * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others
This commit is contained in:
Simon Zolin
2020-10-02 12:51:55 +03:00
parent 128229ad73
commit 69a740714f
4 changed files with 29 additions and 16 deletions

View File

@@ -86,9 +86,10 @@ func processInitial(ctx *dnsContext) int {
}
// disable Mozilla DoH
// https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet
if (d.Req.Question[0].Qtype == dns.TypeA || d.Req.Question[0].Qtype == dns.TypeAAAA) &&
d.Req.Question[0].Name == "use-application-dns.net." {
d.Res = s.makeResponseREFUSED(d.Req)
d.Res = s.genNXDomain(d.Req)
return resultFinish
}