Block Countries in Hostinger CDN: Steps & Limits
In this article
To block countries in Hostinger’s CDN, you use the built-in Geo-blocking feature in hPanel, which lets you allow or deny traffic from specific countries. The main limits are that Geo-blocking works only when your site is using Hostinger’s CDN (not just the basic DNS), and you can only block at the country level—not by region, city, or IP range.
What Is Hostinger CDN Geo-blocking?
Hostinger’s CDN is a content delivery network that caches your site’s static files (images, CSS, JavaScript) on servers around the world. Geo-blocking is a security and traffic-management tool built into the CDN. It examines the visitor’s IP address, determines their country, and then either allows or blocks the request before it reaches your origin server.
This is different from a firewall or an .htaccess rule because it happens at the edge—on the CDN’s servers—so blocked requests never consume your hosting resources. It’s commonly used to stop spam, prevent unauthorized access from certain regions, or comply with licensing restrictions.
How to Block Countries in Hostinger CDN
The process takes about two minutes once you’re logged into hPanel. Here are the exact steps:
- Log in to your Hostinger account and open hPanel for the website you want to manage.
- Go to the Websites section, then click Manage next to your domain.
- In the left sidebar, find the CDN section (sometimes labeled “Hostinger CDN” or “CDN”).
- Click Geo-blocking (or “Geo Blocking” depending on the interface version).
- You’ll see a list of countries with a toggle or checkbox. Select the countries you want to block.
- Choose the action: Block (deny access) or Allow only (whitelist).
- Click Save or Apply to activate the changes.
If you want to block a long list of countries, you can use the search box to find them quickly. The changes usually take effect within a few minutes, though propagation across all CDN edge servers can take up to an hour.
Key Limits You Should Know
Hostinger’s Geo-blocking has several limitations that might surprise you:
- Country-level only: You cannot block by region, state, city, or ISP. You can only select entire countries.
- Requires CDN enabled: The feature only works when your site is using Hostinger’s CDN. If you’ve disabled the CDN, Geo-blocking won’t function.
- No IP range blocking: You can’t enter a specific IP or CIDR block. For that, you’d need a firewall or security plugin.
- IPv6 considerations: Geo-location for IPv6 addresses is less accurate than for IPv4. Some visitors on IPv6 might be misidentified.
- No custom rules: You can’t set time-based rules, rate limits, or conditions. It’s a simple allow/deny per country.
Also, note that Geo-blocking is not available on the free plan. It’s included in Premium, Business, and Cloud hosting plans that come with CDN access.
When Should You Use Geo-blocking?
Geo-blocking is a useful tool, but it’s not always the right solution. Common use cases include:
- Stopping spam: If you get a lot of spam comments or fake registrations from a particular country, blocking that country can reduce the noise.
- Protecting against attacks: If you see brute-force attacks originating from a specific region, you can block that region to slow them down.
- Licensing compliance: If your content or product is not licensed in certain countries, you can block access from those countries.
- Redirecting traffic: While not a redirect, you can use “Allow only” to restrict access to a specific set of countries, which is useful for internal tools or region-specific beta tests.
However, Geo-blocking is not a substitute for a proper security plugin or firewall. It doesn’t protect against sophisticated attacks that use VPNs or proxies to appear from other countries.
How to Check if Geo-blocking Is Working
After you save your settings, you can test it in a few ways:
- Use a VPN to connect from a blocked country and visit your site. You should see an error page or a blank page.
- Use an online “check website from another country” tool (like GeoPeeker or similar) to see what a visitor in that country sees.
- Check your site’s access logs to confirm that requests from blocked countries are not reaching your server.
If you’re not sure whether the CDN is active, you can check by looking at the response headers. If you see “x-hcdn-cache” or similar in the headers, the CDN is handling the request.
Common Problems and Fixes
Here are a few issues you might run into:
- Blocked users still see the site: This usually means the CDN is not enabled, or the visitor is using a VPN. Double-check that the CDN is active in hPanel.
- You accidentally blocked your own country: Go back to Geo-blocking and uncheck your country. If you’re using a VPN, turn it off before testing.
- Geo-blocking doesn’t work with a subdomain: Make sure you’re applying it to the correct domain or subdomain in hPanel.
- Changes take too long: CDN edge servers may take up to an hour to update. Wait a bit and clear your browser cache.
If you’re still having issues, contact Hostinger support—they can verify if the CDN is properly configured for your site.
Alternatives to Hostinger’s Geo-blocking
If you need more granular control, consider these alternatives:
- WordPress plugins: Plugins like Wordfence or iQ Block Country allow you to block by country, and some let you block by IP ranges or add redirects.
- Cloudflare: If you use Cloudflare’s free CDN, you can create firewall rules to block countries, IPs, or even ASNs. This is more flexible than Hostinger’s built-in tool.
- Server-level firewall: On a VPS or dedicated server, you can use iptables or CSF to block IP ranges. This is the most powerful but requires technical knowledge.
- .htaccess: For Apache servers, you can use .htaccess with a GeoIP module, but this is outdated and not recommended for performance.
For most users, Hostinger’s built-in Geo-blocking is sufficient. But if you need to block specific IPs, set up redirects, or create complex rules, a third-party solution is better.
Frequently Asked Questions
Does Hostinger Geo-blocking affect SEO?
No, not directly. Google and other search engines generally don’t penalize sites for blocking access from certain countries. However, if you block a country where you have a significant audience, you could lose traffic and potentially see a drop in rankings for that region. It’s best to use Geo-blocking only when necessary.
Can I block a country but allow specific IPs from that country?
No, Hostinger’s CDN Geo-blocking doesn’t support IP exceptions. If you need to allow certain IPs from a blocked country, you’ll need to use a different tool like Cloudflare or a security plugin.
Will Geo-blocking stop DDoS attacks?
Geo-blocking can reduce the surface area of an attack if the attack comes from a specific country, but it won’t stop a distributed denial-of-service attack. Hostinger’s CDN has some DDoS protection, but for serious attacks, you need a dedicated DDoS mitigation service.
How do I unblock a country?
Simply go back to Geo-blocking in hPanel, uncheck the country, and save. Changes usually take effect within a few minutes.
Does Geo-blocking work for all Hostinger plans?
No, it requires a plan that includes the CDN. Free and single shared hosting plans may not have CDN access. Check your hPanel to see if the CDN section is available.