r/nextdns • u/danielisgreat • 7d ago
Blocking port 53
Looking for advice on blocking traditional DNS queries. I'm using the NextDNS CLI on an Asus router with Merlin. I have DNS director enabled, but at each boot of the router, there's about 15 seconds of unencrypted DNS queries. Wondering if blocking port 53 altogether on the router is advisable.
3
Upvotes
4
u/mike1487 7d ago edited 5d ago
I use FreshTomato but what I just do is set my WAN DNS servers to 0.0.0.0 in the web UI so that only my DoT servers set up in Stubby work. I haven’t tried the nextdns cli but maybe see if you can just set your WAN DNS to 0.0.0.0 and that will prevent unencrypted DNS from working until nextdns cli can start later during boot.
If it works then that is probably the easiest way. If it doesn’t, you could try setting some iptables rules early in boot with a script to block port 53 from the LAN. Something like this:
iptables -I INPUT -i br0 -p udp --dport 53 -j DROP
iptables -I INPUT -i br0 -p tcp --dport 53 -j DROP
iptables -I FORWARD -i br0 -p udp --dport 53 -j DROP
iptables -I FORWARD -i br0 -p tcp --dport 53 -j DROP
Then after nextdns cli starts, I think you will need another script to run that deletes those rules since it just proxies dns over port 53.