I want to block ip address of a whole country from entering in my website. I have seen some of the African and Asian countries that always use my website for unwanted uses. Can drupal do this job or I've to use some off drupal scripts.

Comments

avadhutp’s picture

You should get in touch with your hosting provider. They may be in a better situation to help you out.

Or else, you could use an .htaccess file to do the blocking. There is a website that will generate such a file for you. Here is the link: http://www.blockacountry.com.

greg.harvey’s picture

*bookmarked* =)

BTW, nothing stops you putting those address ranges the website generates in to Drupal IP access rules (admin/user/rules/add).

--
http://www.drupaler.co.uk/

miamia-1’s picture

I used that before but the database kinda outdated. I still prefer this one

http://www.ip2location.com/blockvisitorsbycountry.aspx

at least I've noticed that they actually update their databases every month

I used their htaccess to block the visitors from a dangerous country, they hacked my site :(

But i was wondering, can I block one country but allow access to particular visitors from that country?

dougw’s picture

The latest Prolexic report (Q1 2012) showed 81% off DDoS attacks on the US came from foreign countries. TechGuard makes an in-line appliance to block countries by IP address, but still allow back in specific IPs from blocked countries you want open to your network. Works for both ingress & egress traffic to keep botnets/malware from communicating back to an attacker (most often in a foreign country outside the reach of US law enforcement.)

miamia-1’s picture

I used that before but the database kinda outdated. I still prefer this one

http://www.ip2location.com/blockvisitorsbycountry.aspx

at least I've noticed that they actually update their databases every month

I used their htaccess to block the visitors from a dangerous country, they hacked my site :(

But i was wondering, can I block one country but allow access to particular visitors from that country?

bwv’s picture

I have seen some of the African and Asian countries that always use my website for unwanted uses.

Sounds intriguing... how do they do that?

http://drupal.org/node/203922
----------------------------------------------------------------------
http://www.bwv810.com
http://davidhertzberg.com

I am a writer, researcher and solo drupal freelancer.
Je peux communiquer en français. / Я могу общаться на русском языке.

himagarwal’s picture

@avadhutp: thanks for the link. i used the ip address generated by that site in .htaccess file in one of my website. was wondering if drupal has some modules to handle this work.

@bwv: actually i found people from those origin loading content and images more precisely and the spam that i get are always from these countries.....

Francewhoa’s picture

Comparison of contributed modules for dealing with troublesome users http://drupal.org/node/645216

Or build in Drupal http://drupal.org/node/645218

Loving back your Drupal community result in multiple benefits for you  
ranjeetku’s picture

cfBlockCountry (Plugin)is really nice solution to block any country to access without using ip address.one of my friend asked me to use this.For example if you want to block access of the site from any IP in United States you can use this plugin. I have used this to prevent unwanted access to my website and you can also use this if going through the same problem . you will definitely feel better after using this. you can download it from the given link below:-http://www.codefire.in/open-source.html

eeric49’s picture

This works perfectly for simple solutions. It is helping me at the moment
Block Whole Country

Checkout Affordable Kenya Safari

qqboy’s picture