4

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.

0

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
|improve this answer|||||
0

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.