5

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:

127.0.0.1 unix.stackexchange.com
127.0.0.1 www.unix.stackexchange.com

But with regex it would be easier to something like this

127.0.0.1 .*stackexchange.*

Which would block everything with stackexchangein the url.

5

2 Answers 2

-1

Determine ASN

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

Manage Traffic

for ip in `whois -h whois.radb.net '!gAS25791' | grep /`
do
    iptables -A -s $IP -j DROP
done
-1

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>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .