Hi, thank you for the reply.
As for the rationale - when the webpage contains many elements like banners, pictures, frames, etc, loading it requires several (sometimes more than 10) DNS requests beforehand. It can slow down loading, regardless of the content transfer (which is sometimes cached by Squid webproxy).
As for the SERVFAIL, you are totally right.
I've checked that the domain of the public.host
is registered in the root DNS servers, BUT it does not have the relevant NS or SOA records - so that's why I get SERVFAIL instead of NXDOMAIN.
As this server indeed is not resolving and is not needed, I need to add it as a static entry, to stop sending queries about it, right?
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29629
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; EDE: 9 (DNSKEY Missing)
;; QUESTION SECTION:
;some.public.host. IN A
;; Query time: 274 msec
;; SERVER: 9.9.9.9#53(9.9.9.9) (UDP)
;; WHEN: Wed Apr 02 10:19:06 UTC 2025
;; MSG SIZE rcvd: 56
As for the blocked and forwarded entries, I investigated it a bit, and in most cases the queries were not sent upstream, but sometimes still they were:
Apr 2 10:52:20 dnsmasq[1707711]: query[A] www.should_be_blocked.com from 192.168.0.210
Apr 2 10:52:20 dnsmasq[1707711]: exactly denied www.should_be_blocked.com is 0.0.0.0
Apr 2 10:52:22 dnsmasq[1707711]: query[A] www.should_be_blocked.com from 192.168.0.210
Apr 2 10:52:22 dnsmasq[1707711]: exactly denied www.should_be_blocked.com is 0.0.0.0
Apr 2 10:52:24 dnsmasq[1707711]: query[A] www.should_be_blocked.com from 192.168.0.210
Apr 2 10:52:24 dnsmasq[1707711]: exactly denied www.should_be_blocked.com is 0.0.0.0
Apr 2 10:52:26 dnsmasq[1707711]: query[A] www.should_be_blocked.com from 192.168.0.210
Apr 2 10:52:26 dnsmasq[1707711]: forwarded www.should_be_blocked.com to 9.9.9.9
Apr 2 10:52:26 dnsmasq[1707711]: reply www.should_be_blocked.com is <CNAME>
Apr 2 10:52:26 dnsmasq[1707711]: reply www.should_be_blocked.com.should_be_blocked.jiasu.com is <CNAME>
Apr 2 10:52:26 dnsmasq[1707711]: reply www.should_be_blocked.com.w.kunluncan.com is blocked during CNAME inspection
Apr 2 10:52:26 dnsmasq[1707711]: exactly denied www.should_be_blocked.com is 0.0.0.0
This happened only about 20 times in the last 24 hours, while the client queries are sent every five seconds, so it's not a big deal - I was just surprised to see the domain in the tcpdump logs captured for the upstream traffic.
I got the bottomline from the responses given - the reducing upstream queries is not trivial and it's not worth the effort. Most likely you are right, even if I save a second or two, it's not much. I just hoped for some simple solution, not requiring to dig deeper in the internals.
My last question: when I add the local DNS record, it seems it is used in A queries only, but not with HTTPS queries. Is there any way to force the local DNS records to be used in HTTPS responses as well (as IPv4 hints)?