Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to disallow proxies and spambots from posting in my website. What is the best way to do so?

I've downloaded a blacklist and my first idea was to disable each of ips in my .htaccess file, but after downloading the list, I found out that it contained almost 9 million entries.

My other idea was to split each IP in 4 parts and do [1;4] successive SQL queries in my POST.

Yet if I could cache this values on memory, I could inexpensively check for them with something like (:200 (:188 (:10 (:42)))). Is this doable with PHP?


share|improve this question
up vote 1 down vote accepted

Have you thought about using a CAPTCHA such as reCAPTCHA? They seem to be the industry standard for avoiding non-humans to post and would be much simpler to implement than an IP filter of 9 million blacklisted IPs.

share|improve this answer
This approach could work against a spambot, but it wouldn't disallow regular users from using proxies – user21690 Oct 9 '09 at 19:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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