I use DNS-over-TLS (DoT) to forward queries from my home router to a Cloudflare Gateway location. The policy I have assigned contains a block for one domain and the block page is enabled. Queries to that domain using the Zero Trust client (in DNS-only mode or Warp mode) receive the block page IP address as expected. Similarly, queries without the client over UDP53 receive the block page IP as well (as expected).
However, queries for the blocked domain over the DoT connection receive a SERVFAIL response, causing another query to be generated using the next DNS server issued by the DHCP server. I can see the block being logged in the Gateway logs over TLS, but I’m not sure why the response is SERVFAIL.
For me, kdig -d @162.159.36.20 +tls +tls-sni=abc123.cloudflare-gateway.com malware.testcategory.com returns the blocking page IPv4 address and ;; ->>HEADER<<- opcode: QUERY; status: NOERROR; id: 18835. So, I could not reproduce this.
That’s not fully reproducing the steps. From what I can tell, category-based blocks over DoT work as expected. A custom block (add a specific domain to a rule to block) seems to be logged as a block but the response is SERVFAIL.
192.168.1.158 is my pi-hole, which is configured to send queries upstream to my router (which has the DoT connection to CF). You can see the servfail after it fails back to the router IP directly.
[email protected] ~ % nslookup foxnews.com
;; Got SERVFAIL reply from 192.168.1.1, trying next server
If I set up a backup to go straight to Cloudflare Gateway (or use the Zero Trust client to send queries directly), the block works as expected.