Block countries from accessing my website

Posted July 11, 2014 7k views

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

Thank you.


Chris Anthony

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
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.