resolved: address DVE-2018-0001
This is an updated version of #8608 with more restrictive logic. To
quite the original bug:
Some captive portals, lie and do not respond with the captive portal
IP address, if the query is with EDNS0 enabled and D0 bit set to
zero. Thus retry "secure" domain name look ups with less secure
methods, upon NXDOMAIN.
https://github.com/dns-violations/dns-violations/blob/master/2018/DVE-2018-0001.md
Yes, this fix sucks hard, but I guess this is what we need to do to make
sure resolved works IRL.
Heavily based on the original patch from Dimitri John Ledkov, and I
copied the commentary verbatim.
Replaces: #8608