Skip to main content

How to Block IP addresses in cPanel

How to block IP addresses or domains from accessing your website using IP Blocker in cPanel.

IP Blocker allows you to prevent access to your website from specific IP addresses, IP sites, or domains. This is useful for protecting the site from unwanted traffic or repeated attacks.

Overview

IP Blocker in cPanel is used to block access to your website based on IP addresses or domain names.

This feature has several advantages. You can:

  • Block single IP addresses

  • Block entire IP ranges

  • Prevent unwanted traffic from specific sources

  • Easily manage all the options directly in cPanel

When you finish this guide, you will know how to block and remove IP addresses in cPanel.


Important information

IP Blocker only affects access to your website, not other services such as email or Webmail.

⚠️ Important: Server-level blocking must be handled by the hosting provider or via WHM (Host Access Control). IP Blocker in cPanel only applies to your account and your websites.

When you block an IP address, the rule is stored in the .htaccess file of your website.


Prerequisites

Before you start, make sure:

  • You have access to cPanel

  • You have access to IP Blocker

  • You know the IP address or domain you want to block


Step 1: Log in to cPanel

If your hosting service supports cPanel, you can log in directly from the dashboard in the customer area.

This is how you do it:

  • Find your hosting service under the list of active products/services

  • Click on the button "Log in to cPanel"

  • You are now automatically logged into cPanel without having to enter your username or password again


Step 2: Open IP Blocker

Go to the Security section of cPanel and click on IP Blocker.

You will now see the interface for adding and managing blocked IP addresses:


Step 3: Block an IP address

  1. In the IP address or Domain field, enter the IP address or domain you want to block.

You can use multiple formats:

  • Single IP address (for example 10.5.3.33)

  • IP range (for example, 10.5.3.3-10.5.3.40)

  • Implicit area (for example, 10.5.3.3-40)

  • CIDR format (for example, 10.5.3.3/32)

  • Partial IP address (for example 10.)

2. Click on Add to add the blocking rule.

⚠️ Important: If you enter a partial IP address like 10., it will block all IP addresses starting with 10.*, which can prevent many users from accessing the site.

If the block was successful, a message will appear:

You can click on Go Back to get back to the overview.


Step 4: See blocked IP addresses

Under the Currently-Blocked IP Addresses section, all blocked IP addresses are available.

The system displays the blockages in CIDR format, along with:

  • Beginning IP for the range

  • Ending IP for the range

  • The server's internal CIDR format

This makes it easier to understand which IP ranges are actually blocked.


Step 5: Remove a Blocked IP Address

If you want to unblock the IP address or domain:

3. Find the IP address in the blocked IPs list.

4. In the Actions column, click on Delete.

Then click on Remove IP to confirm.

The IP address will now be removed from the blocking list, and access will be restored.


Summary

You have now learned how to block and remove IP addresses in cPanel using IP Blocker.

This feature makes it easy to protect your website from unwanted traffic by blocking specific IP addresses or entire IP ranges directly from cPanel.

Did this answer your question?