Block countries from accessing my website

July 11, 2014 2k views

Hello. Can you help me block specific countries from accessing my website.

Thank you.


Chris Anthony

3 Answers

Why? What are you trying to accomplish by doing this? How are you going to determine the "country" of an IP? These questions can change the answer completely.

How detailed do you want the list. If you want to do mass blocking you could use

For instance if you want to block all APNIC (Asia Pacific ips) firewall off all the APNIC /8 entries. lets you do it by country but that take a lot of time to compile a list unless you are targeting only a couple countries.

Of course they could always use a proxy to bypass this.

I recommend you setting up your website with Cloudflare, I believe that they have a feature that allows you to block certain countries from accessing your website.

Have another answer? Share your knowledge.