The IP Blocker tool in cPanel allows you to block access to your website from specific IP addresses or domains. This security feature helps protect your site from unwanted traffic, malicious visitors, or spam bots by denying access at the server level.
What is IP Blocker?
IP Blocker is a cPanel security tool that lets you deny website access to one or more IP addresses or fully qualified domain names (FQDNs). When you block an IP address, the system adds it to your .htaccess file, preventing that address from accessing your site. This feature is especially useful for stopping repeat offenders, blocking known malicious IPs, or preventing access from specific geographic regions.
If you need server-wide blocking (across all accounts), WHM users can use the Host Access Control interface located in WHM under Security Center to block IPs at the server level rather than per-website.
How to Block an IP Address
Blocking an IP address through cPanel's IP Blocker is straightforward. Follow these steps to deny access to unwanted visitors:
- Log into your cPanel account and navigate to the IP Blocker tool (usually found under Security).
- In the IP Address or Domain text box, enter the IP address or range you want to block.
- Click the Add button to save your changes.
The system will automatically process your entry, convert it to the proper format, and add it to your .htaccess file to block the specified address immediately.
Supported IP Address Formats
The IP Blocker tool accepts several different IP address formats, giving you flexibility in how you specify which addresses to block:
- Single IP address: Block one specific IP (example: 10.5.3.33)
- IP range: Block a range of IPs (example: 10.5.3.3-10.5.3.40)
- Implied range: Simplified range notation (example: 10.5.3.3-40)
- CIDR format: Standard network notation (example: 10.5.3.3/32)
- Implied IP address: Block entire subnets (example: 10.)
Important: Be careful when using implied IP addresses like "10." because this represents 10.*.*.*, which means any IP address starting with 10 will be blocked. This could potentially block thousands or millions of IP addresses, including legitimate visitors.
If you manually edit your .htaccess file directly (outside of cPanel), make sure to enter IP addresses in CIDR format only to ensure compatibility.
Understanding Currently-Blocked IP Addresses
After you add IP addresses to block, cPanel converts them into CIDR format and stores them in your .htaccess file. The IP Blocker interface displays all blocked addresses in a table with three columns:
- Server Setting: Shows the IP address or range in CIDR format as it appears in your configuration
- Beginning IP: Displays the first IP address in the blocked range
- Ending IP: Shows the last IP address in the blocked range
This table helps you visualize exactly which IP addresses are currently denied access to your website. You can also use this interface to remove blocks by clicking the delete option next to any entry.
When to Use IP Blocker
The IP Blocker tool is most effective in these situations:
- Blocking spam bots: Stop automated bots that repeatedly submit spam through your contact forms or comments
- Preventing brute force attacks: Block IPs that are attempting to guess passwords on your login pages
- Stopping harassment: Deny access to specific users who are abusing your website or services
- Reducing server load: Block IPs that are making excessive requests and consuming server resources
- Geographic restrictions: Prevent access from regions where you don't do business (though IP ranges can be broad)
For comprehensive website security, OBHost recommends combining IP Blocker with other security measures like strong passwords, SSL certificates, and regular software updates.
Frequently Asked Questions
Can I block an entire country using IP Blocker?
While technically possible by entering all IP ranges for that country, this approach is not practical in cPanel's IP Blocker. Countries have thousands of IP ranges, and manually entering them all would be time-consuming. For geographic blocking, consider using specialized firewall rules or third-party security plugins that offer country-level blocking features.
What happens if I accidentally block my own IP address?
If you block your own IP address, you will lose access to your website immediately. To fix this, you'll need to access your cPanel account from a different IP address (such as through a mobile network or VPN) and remove your IP from the blocked list. Alternatively, contact your hosting provider's support team to remove the block for you.
Does IP Blocker affect search engine crawlers?
IP Blocker will block any IP address you specify, including search engine crawlers like Google or Bing if you accidentally block their IP ranges. Be very careful not to block IP ranges used by major search engines, as this will prevent them from indexing your site and hurt your SEO rankings. Always verify IPs before blocking broad ranges.
Is there a limit to how many IP addresses I can block?
There's no strict limit in cPanel, but blocking extremely large numbers of IP addresses can impact server performance and make your .htaccess file difficult to manage. For blocking hundreds or thousands of IPs, consider server-level firewall solutions that are more efficient at handling large blocklists.
If you need help configuring IP blocking or have questions about protecting your website from unwanted traffic, OBHost's support team is available 24/7. Visit our contact page or email support@obhost.org for assistance with security settings and best practices.