The steps below will allow you to un-access visitors from a specific IP Address or Domain Name. The easiest way is to do this through your cPanel. You can also do so by editing your .htaccess file in your directory.
IP block of cPanel:
Login to your 'cPanel'.
Under "Security", select the "IP Blocker" menu.
Under 'Add an IP Deny:' enter the IP address or Domain name that you want to block from accessing your site.
Click “Add”
IP block using the .htaccess file:
If you want to block ip with .htaccess add the code below to your .htaccess file:
order allow,deny
deny from 218.111.10.220
deny from .domain.com
allow from all
The first line tells .htaccess what you want to specify. The second and third lines will invalidate a single IP or Domain name. The fourth line allows access to others.
If a banned visitor tries to access the specified location (where the .htaccess file is located), they will see a 403 Forbidden Access Error Page.
NOTE:
To remove an IP ban, all you need to do is delete the string in your .htaccess file or choose from the drop down menu on the IP Deny Manager page.