
Cutting Edge Spam Elimination
SpamButcher uses geolocation data in its code for blocking spam email. It uses this information in conjunction with other data to provide the best spam blocking performance for its users.
Free Anti-Spam Download - Click Here!
How to Block a Given Country Using .htaccess (example for China, Russia and Korea)
Blocking specific networks using Apache's .htaccess file is pretty easy.
For instance, adding...
deny from 221.140.10.0/24
..would block any traffic from the 221.140.10.0 Class-C network (AKA a slash-24).
So blocking specific countries is just a matter finding out all the networks in those countries, then creating a series of entries like the above.
A few different online databases track this information. The best one in my opinion is currently Software 77's.
Blackholes.us seems less complete - but provides the data in a single easy-to-parse file.
I personally have had the most problems with traffic from Korea, Russia and China. We've enountered a large number of attempts to pirate our spam blocker program originating from those nations (although we also block a few others - I'll mention India by name).
If you hypothetically wanted to block those countries - you could add the following file to your .htaccess:
Networks's belonging to China, Korea and Russia - preformatted for .htaccess blocking
Don't copy this right over your .htaccess file - you may have other stuff in there your server needs to run properly.
Other articles on restricting access from certain countries:
How to Block all Email / Traffic from a Given Country using IPSEC (Windows Server 2003 and XP)
How to Block all Email, Web or any other Traffic from a Given Country using Iptables (Linux)
Back
|