Since june 2005 Drupal features a method to ban certain IPs. Mainly meant for banning ugly spiders, like AskJeeves, but also very hand for banning spam harvesters. This page contains a list of IPs I ban on this server. I recollect these every now and then, from spam.modules database, from the logs and from various online resources. Feel free to post any additions in comments, but please add a resource about that IP.

An auto-generated list from the spam module can be dowloaded here. But be carefull with using that list, for spammers will often use false or hacked IPs.

The cron for generating such a list looks somthing like this. echo "SELECT c.hostname FROM spam_comments s, comments c WHERE s.cid = c.cid AND s.spam = 1 AND s.rating > 95 group by c.hostname;" | mysql -u xxx -D xxx | sudo tee /xxx/files/spam_list.log

This article was published on And migrated to this blog.


About the author: Bèr Kessels is an experienced webdeveloper with a great passion for technology and Open Source. A golden combination to implement that technology in a good and efficient way. Follow @berkes on Mastodon. Or read more about Bèr.