There are many ways to do this and i have seen posts about this in this form so have a search for IP banning or sommit
But there are 3 ways i know of
Javascript= Unsucure if someone turns javascript off in there browser
PHP= Not All hosts support php but otherwise good
.htaccess= Works on all host that i know of
So i will cover .htaccess
I know how to do it if you dont have php installed (if you are using a free web-server)
Open a new notepad document or wordpad.
Add the following to your file.
deny from 00.00.00.00
If you have made custom 404/403/500 pages then add the above line under the 404pages like this:
ErrorDocument 403 http://mysite.com/403.html
deny from 00.00.00.00
Change 00.00.00.00 to the IP address that you want to block. If you need to block more than one, just add it below the other one, like this:
ErrorDocument 403 http://mysite.com/403.html
deny from 00.00.00.00
deny from 00.00.00.00
SAVE AS htaccess.txt and upload this file in ASCII.
Once its uploaded right click on the file and go to rename to change the file name and change it to .htaccess YES you will be removing the .txt from it and adding a PERIOD in front of the word.
It might look like it disppeared but its still there. So from now on anyone who visits your site that is on that banned list, will get a 403 Forbidden page.
Remember to Rename it correctley
Thats is assuming you have the IP you want to ban😛