Is there any tool/application that I can use to block hosts from all forms of connection from my computer? Currently I use /etc/hosts and place the absolute host like this: unix.stackexchange.com www.unix.stackexchange.com

But with regex it would be easier to something like this .*stackexchange.*

Which would block everything with stackexchangein the url.


Determine ASN

whois -h whois.radb.net `dig +short stackoverflow.com`

Manage Traffic

for ip in `whois -h whois.radb.net '!gAS25791' | grep /`
    iptables -A -s $IP -j DROP
|improve this answer|||||

As for hassle-free solutions, many use fail2ban: http://www.fail2ban.org/

Rules can be customised, see http://www.fail2ban.org/wiki/index.php/Commands

set <JAIL> addfailregex <REGEX>

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.