I'm looking to implement the recommended mitigation measures:
The simplest mitigation, though, is to disallow outgoing ICMP replies altogether.
At the moment, I have the following rules, mostly untouched from a default firewall config:
Allow-Ping
Allow-MLD
Allow-ICMPv6-Input
Allow-ICMPv6-Forward
I'd say "Allow-Ping" has to go... am I correct?
Another easy fix is to set the timeout of DNS queries more aggressively.
You only have to change the default firewall rule for WAN from REJECT to DROP (for both INPUT and FORWARD) or update to newer Linux kernel. Those four rules are fine. More a protocol issue rather than a DNS server issue though there are some mitigations like cookies which dnsmasq unfortunately doesn't implement.
If I understand correctly, DoT has terrible performance costs and works best when using a single upstream server, such as CloudFlare or Google. I moved to Unbound precisely to run a recursive server on my own and be done with ISP filtering, so I am not too keen on going back to a single chokepoint.
So typically DoT is enough to solve the issues of DNS hijacking/filtering/leaks by the ISP.
At the very least, it shouldn't be that bad unless your router is very old.
Moreover just using recursive DNS cannot protect you against DNS hijacking.
Check tcpdump and see for yourself.
Yeah. Unfortunately not enough of the DNS system has DNSSEC and your ISP can intercept and change entries. Also raw recursion has no point-to-point security so your local ISP can snoop your traffic and use it for profiling. Cloudflare and Mozilla are both keen to bust ISP exploitation of customer data, so 1.1.1.1 will be seen by most with a desireable behavior and privacy policy in print. Quad9 has similar privacy policy for their main server 9.9.9.9, but they also have a malware-site blocker. This may interfere with research or developing your own adblock/malware-block tools. 9.9.9.11 is wide open, but then it has more privacy leaks because it forwards original query IP or at least subnet. And Google is Google ...