I am getting some denied DNS queries I'd like to ban using iptables, to avoid bind to send augmented replies to the server ... and that they're simply annoying in my logs.
(.): query (cache) './ANY/IN' denied
I know that, with queries like
(domain.com): query (cache) 'domain.com/ANY/IN' denied
I can block with just:
iptables -I INPUT -j DROP -p udp --dport 53 -m string --hex-string "|06|domain|03|com|0000ff0001|" --algo bm
But I'm not sure about this "generic" query to ./ANY/IN
. At first it looks like something like this:
iptables -I INPUT -j DROP -p udp --dport 53 -m string --hex-string "|0000ff0001|" --algo bm
might do... but then I wonder if I won't be blocking queries for anything
(small note: usually people don't care about the last 00ff0001
bit I am using, they are the bytes for the query type and class, if you're curious about it)