block domains using iptables

been having a lot of trouble with con­stant attacks on one of my servers (see this post). the attacks have become so severe that i’ve decided that simply banning indi­vidual ip addresses isn’t enough. i’m now block­ing any ip ori­gin­at­ing in poland or russia. this may seem rather extreme but as this server doesn’t actu­ally host a website that deliv­ers content then it shouldn’t be getting many non-malicious vis­it­ors anyway.
just issue the fol­low­ing from the command line (as root) to update iptables…replacing ‘blocked.com’ with the domain/ip address that you want to thwart.

ipt­ables –A INPUT –m string –algo bm –string “*blocked.com” –j DROP

Post to Twitter

0 Responses to “block domains using iptables”


Comments are currently closed.

Bear