Knowledge Base

How to Block and Unblock IP Addresses in cPanel

How to Block and Unblock IP Addresses in cPanel

1- Log in to your Dashboard

◦ Go to Dashboard 

◦ Select Services then click on active on your hosting service.

◦ Click login to cPanel to access your cPanel dashboard.


 

2 - How to Block an IP Address

  • Open IP Blocker in your cPanel (located under Security).



  • In the field labeled Add an IP or Range, enter the IP, IP range, or domain you want to block.



 

Examples:

    • Single IP: 192.168.1.25
    • IP Range: 192.168.1.1-192.168.1.255
    • Domain: example.com

 

  • Click Add.



The IP is now blocked and will no longer be able to access your website.

 

 

 

3-  How to Unblock an IP Address

If you need to remove an IP or domain from the block list:

  1. Go to Security → IP Blocker.

  2. Scroll down to the list of blocked IPs/domains.
  3. Find the IP or domain you want to remove.
  4. Click Delete next to it.

  5. Confirm by clicking Remove IP.


 

The IP is now unblocked and can access your website again.

4- Block All Visitors Using .htaccess (Advanced)

If you want to deny access to everyone except specific IPs:

  1. Open File Manager from cPanel.
  2. Navigate to your site’s root folder (public_html).
  3. Open the .htaccess file.
  4. Add the following code:



5-  Save & Test

  • Reload your website.
  • Confirm that blocked IPs cannot access it.
  • Make sure allowed IPs can still access the site normally.

 

Please rate this article to help us improve our Knowledge Base.

0 0