IP Blocking: Looking for Supreme Technique

IP blocking

I see via the cpanel that the “IP Blocker” is limited to adding one IP or range at a time.
Which seems a little cumbersome and time-consuming for my goals. What would be the best way to quickly add, site-wide IP blocking with a list of thousands?

I’m aware that there are multiple techniques out there. I am looking specifically for a “already baked” technique that is native to the environment of infinityfree.

Thanks to All!

This is probably not a good thing to do. You don’t know who is using which block of IP addresses. If you block entire ranges of IPs you could potential block a lot of potential viewers to your site. Blocking 1 or 2 IPs won’t cause an issue. But, blocking a whole subnet could potentially prevent thousands (or millions) or people from accessing your website.

Years ago I helped manage a forum. We kept getting trolled from a particular range of IP addresses. So, we blocked the entire range (0-255). Then, we started getting hundreds of complaint from other customers who couldn’t access our site. Turns out the IP block was for some public WIFI service they used in cafes. By blocking the IPs we blocked anyone else who was using that public wifi service too. We ended up removing the large IP ban and went back to banning individual IPs that were causing problems.


Thank you for that insight. I’ll keep that in mind. However if I wanted to proceed to various degrees is there a better option then manually inserting? Thanks

1 Like

You could probably do it via an .htaccess file:


Yeah, okay thanks… I ran across that .htaccess while I was quickly learning…
But couldn’t come to the conclusion on whether that was the ticket to Ride… So thanks for clarifying… And, wouldn’t I want to block all of the blacklisted ips?

That’s what I wish to do. I want keep my site up to date on the blacklisted iPS and emails.

I have “Mad Hate”, I absolutely “Hate” all fraudulent and deceptive people, I don’t care where they’re from, who they pray to, what their skin color is, or what they like to do in their bedroom with their private parts, or anything else for that matter. With American$ Hate is Great!

American$: Make Hate Great Again!
lol…I just had to do it!

A selfish promotion at Trump’s expense, now that’s American$!

1 Like

Yep. Just add your IPs to the .htaccess DENY statements. You may need a few of them. Then, upload the .htaccess file to your htdocs folder and those IPs will be blocked.


I just realized you said “probably”, so then you aren’t certain…copy that

By “probably” he meant that you could also do it in other ways than modifying htaccess.


Please note that there is a size limit of 10 kB for .htaccess lines. So if you need a very big list of IP blocks, for example to block entire countries, you’ll need to find another way.

IMO blocking entire countries with IP block statements is misguided because you’re effectively stating “everyone in this country is evil, and everyone else is good”. Stopping abuse is generally more effectively done through WAFs (like from Cloudflare) or by using CAPTCHAs. And if you insist on doing geo restrictions, doing those from PHP lets you have a more user friendly block page than “403 Forbidden”.


Yes. It’s just one method to achieve the desired outcome.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.