User Tools

Site Tools


How to Block and Unblock IP Addresses from Accessing Your Site Using the cPanel IP Blocker

Although a VPS or Dedicated Server will often already have a firewall installed, to detect potentially-malicious behavior and automatically block those IP addresses from making any connections to the server, sometimes you will only want to keep an IP address from accessing a particular website. This is often done using .htaccess rules, but cPanel also has a feature to help create these rules for you.

How to Block an IP Address or Address Range

First, you will need to login to cPanel.

Then, in section "Security", click "IP Blocker":

Next, enter the IP address or address range in the box and click "Add":

You should then see a confirmation screen like this:

Then when you go back, you should see the newly-added IP or range in the "Currently-Blocked" list:

If desired, you can check the site's .htaccess file and see that the block is there:

  root@host [~]# tail -1 /home/USER/public_html/.htaccess
  deny from X.X.X.X

How to Unblock an IP Address or Address Range

This will only work if the cPanel IP Blocker is how the IP was blocked in the first place. Otherwise, the unblocking will need to be done another way. For assistance determining how to do this on your KnownHost VPS or Dedicated Server, please don't hesitate to open a Support Ticket!

First, log into cPanel and access the IP Blocker page as shown in the previous section.

Look in the list for the IP address or address range you would like to unblock, and click the "Delete" button in that row:

cPanel will ask you if you are sure. If you are sure you want to unblock the IP, click "Remove IP". Otherwise, click "Cancel":

After unblocking the IP, you should see a confirmation screen like this:

Then when you go back, the IP address will no longer be listed in the "Currently-Blocked" list:

Remember, if the IP was blocked by something other than the IP Blocker, the block will need to be removed some other way, depending on how it was initially blocked.

control-panels/cpanel-whm/ip-blocker.txt · Last modified: 2020/06/02 11:52 by Karson N.