Are visitors from a certain country prevented from visiting your website or server? (You should check!)
We had an interesting problem the other day with a client’s server IP being blocked from Russia. Let’s go over how we diagnosed the issue and then how we got around it.
1. Check if the server IP is blocked from any countries.
- Visit http://ping.pe/
- Enter in your server IP and see which countries are blocking it.
- Ideally, the “Loss %” column is showing 0% for each location and mostly solid green bars in the “Chart” column.
- China is usually the toughest firewall to get through.
- You can also check other websites that specifically check from certain countries. Some allow you to search from IP, others by domain, and others allow searching by both.
Did you see your IP being blocked from certain countries? If so, move on. If not, it’s probably your website that is being specifically blocked!
2. Changing your server IP
There are several methods to get around this.
- Shared hosting – if you’re on shared hosting, your only bet is to enable Cloudflare so that your website is being browsed from THEIR proxy server IP instead of your own.
- VPS – if you’re on a VPS, the easiest way is to get another VPS from the same datacenter and then swap IP’s with it. What you should do is simply spin up a tiny VPS, and then check its IP. If its IP isn’t blocked, then resize it to match the size of your current server, then clone everything over and update your IP settings on the new machine. Or if you’re too lazy to do all this, you can also go the Cloudflare route here as well.
- Dedicated – if you’re on a dedicated server, ask your webhost to provide another IP.
Some people create a whole separate proxy server which is then used only if a block is detected but this is way more technical than I think is convenient for most users.
3. Preventing your IP from getting blocked
To be honest, I’m not sure how IP’s get blocked from certain countries. Maybe it was hosting banned content or some political/religious site. Maybe it was previously used by a hacker who attacked prominent servers from that country. That’s my guess. Just act responsibly and you should be ok!