Click here to Skip to main content
12,749,593 members (32,958 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 16 Jun 2014

Why IP Bans Are Not Always a Good Idea

, 16 Jun 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
Why banning a specific IP address is not always a good idea

Some websites ban specific IP addresses to block users with intolerable behaviour. But these bans are not always a good idea. Why not? Because changing your IP address is very easy: just turn off your router and turn it on again, and your IP is changed (if you have a dynamic IP and not a static one). But even if you have a static IP, changing it into a dynamic IP is very easy. So banning an IP is not very effective, and, even worse, it can also block an innocent user if the banned IP is assigned unforeseen to that user.

But can IP bans be effective? Yes, they can, if you want to ban an anonymous open proxy, because their IP addresses don’t change that much. It can also be effective if you want to ban someone for a short time, for example if someone is continuously sending requests to your website. You don’t disturb other users with the same IP too much (at least if you tell the reason), and you prevent the attacker from sending more requests.

But I want to block a user permanently! How can I do that?
Well, in fact, you cannot really prevent someone from accessing your website. The best you can do is using a user account system, and block the email address of annoying users. It doesn’t really stop them because they can keep creating new email addresses, but it’s better than nothing. Also, when doing that, make sure that you confirm the email address before the account is created. Otherwise, someone can use a non-existing email address and it won’t change anything if that email address gets banned.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Belgium Belgium
I'm a hobbyist programmer. I work mostly in C#, JavaScript, and Python. I also like chess; you can find me on Lichess.

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170215.1 | Last Updated 16 Jun 2014
Article Copyright 2014 by ProgramFOX
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid