{"id":59,"date":"2026-05-03T11:32:46","date_gmt":"2026-05-03T18:32:46","guid":{"rendered":"https:\/\/cpanelreview.com\/index.php\/2026\/05\/03\/block-ip-addresses-cpanel-ip-blocker-csf-cphulk\/"},"modified":"2026-05-03T11:32:46","modified_gmt":"2026-05-03T18:32:46","slug":"block-ip-addresses-cpanel-ip-blocker-csf-cphulk","status":"publish","type":"post","link":"https:\/\/cpanelreview.com\/index.php\/2026\/05\/03\/block-ip-addresses-cpanel-ip-blocker-csf-cphulk\/","title":{"rendered":"How to Block IP Addresses in cPanel: IP Blocker, CSF, and cPHulk Guide"},"content":{"rendered":"<h2>Why IP Blocking Matters for Your cPanel Server<\/h2>\n<p>Every day, automated bots, brute-force attackers, and malicious scanners probe cPanel servers looking for vulnerabilities. Without proper IP blocking, your site wastes resources handling unwanted traffic and risks unauthorized access. cPanel provides built-in tools to block specific IP addresses or entire ranges at the server level \u2014 stopping threats before they ever reach your applications.<\/p>\n<p>Whether you&#8217;re dealing with a single persistent attacker or a distributed botnet, cPanel&#8217;s IP Blocker and firewall integration give you granular control over who can connect to your server. This guide walks through the practical methods for blocking IPs in cPanel, from the easy point-and-click interface to command-line firewall rules for power users.<\/p>\n<p><!--more--><\/p>\n<h2>Using the cPanel IP Blocker Interface<\/h2>\n<p>The simplest way to block an IP address is through the <strong>IP Blocker<\/strong> tool in cPanel. This feature adds rules to your server&#8217;s firewall (typically CSF or iptables) behind the scenes, so you don&#8217;t need to touch the command line.<\/p>\n<h3>Accessing IP Blocker<\/h3>\n<ol>\n<li>Log into your cPanel dashboard<\/li>\n<li>Navigate to the <strong>Security<\/strong> section<\/li>\n<li>Click <strong>IP Blocker<\/strong><\/li>\n<li>You&#8217;ll see a list of currently blocked addresses and a form to add new ones<\/li>\n<\/ol>\n<h3>Adding an IP or Range<\/h3>\n<p>In the <strong>Add an IP or IP Range<\/strong> field, you can enter:<\/p>\n<ul>\n<li><strong>A single IP:<\/strong> <code>192.168.1.100<\/code><\/li>\n<li><strong>A CIDR range:<\/strong> <code>192.168.1.0\/24<\/code> (blocks 192.168.1.0 through 192.168.1.255)<\/li>\n<li><strong>A wildcard range:<\/strong> <code>192.168.1.*<\/code> (equivalent to the \/24 range above)<\/li>\n<li><strong>A partial IP:<\/strong> <code>192.168.<\/code> (blocks everything starting with 192.168)<\/li>\n<\/ul>\n<p>After entering the address, click <strong>Add<\/strong>. The block takes effect immediately. You&#8217;ll see the new rule appear in the list below with a timestamp. To remove a block later, click the <strong>Delete<\/strong> link next to the IP entry.<\/p>\n<div class=\"wp-block-cgb-block-callout\">\n<p><strong>Note:<\/strong> Be careful with broad ranges. Blocking a large ISP range like <code>10.0.0.0\/8<\/code> could lock out legitimate visitors. Always verify the IPs you&#8217;re blocking belong to known attackers.<\/p>\n<\/div>\n<h2>Blocking IPs Through cPanel&#8217;s ModSecurity Integration<\/h2>\n<p>cPanel also integrates with <strong>ModSecurity<\/strong>, a web application firewall that can block IPs based on attack patterns. When combined with the <strong>cPanel ModSecurity Rule Editor<\/strong>, you can create custom rules that block specific IPs from accessing your web applications while still allowing other services like email or FTP.<\/p>\n<p>To create a ModSecurity IP block:<\/p>\n<ol>\n<li>Go to <strong>ModSecurity<\/strong> in the Security section of cPanel<\/li>\n<li>Select the domain you want to protect<\/li>\n<li>Click <strong>Add a Custom Rule<\/strong><\/li>\n<li>Paste a rule like:<\/li>\n<\/ol>\n<pre><code>SecRule REMOTE_ADDR \"^192\\.168\\.1\\.100$\" \\\n    \"id:100001,phase:1,deny,status:403,msg:'Blocked malicious IP'\"<\/code><\/pre>\n<p>This blocks the specified IP at the web application layer, returning a 403 Forbidden response. The advantage over the IP Blocker is that ModSecurity rules can be more specific \u2014 for example, blocking an IP only for certain URLs or during certain hours.<\/p>\n<h2>Using CSF (ConfigServer Security &amp; Firewall) with cPanel<\/h2>\n<p>Most cPanel servers include <strong>CSF<\/strong> (ConfigServer Security &#038; Firewall), a powerful firewall management system. CSF gives you more advanced IP blocking capabilities than the basic IP Blocker tool.<\/p>\n<h3>Blocking an IP in CSF<\/h3>\n<p>If you have root access or WHM reseller permissions, you can manage CSF directly:<\/p>\n<ol>\n<li>Log into <strong>WHM<\/strong> or SSH into your server<\/li>\n<li>Run: <code>csf -d 192.168.1.100<\/code> \u2014 this denies (blocks) the IP<\/li>\n<li>To confirm the block: <code>csf -g 192.168.1.100<\/code><\/li>\n<li>To remove: <code>csf -dr 192.168.1.100<\/code><\/li>\n<\/ol>\n<h3>Temporary Blocks with CSF<\/h3>\n<p>CSF also supports time-limited blocks via its temporary deny feature:<\/p>\n<pre><code>csf -td 192.168.1.100 3600<\/code><\/pre>\n<p>The third argument is the duration in seconds. The example above blocks the IP for one hour (3600 seconds). After expiration, the IP is automatically removed from the deny list.<\/p>\n<h3>Managing CSF Through WHM<\/h3>\n<p>For users who prefer a GUI:<\/p>\n<ol>\n<li>Log into <strong>WHM<\/strong><\/li>\n<li>Search for <strong>ConfigServer Security &#038; Firewall<\/strong><\/li>\n<li>Click <strong>Firewall Deny IPs<\/strong> under the Quick Actions section<\/li>\n<li>Paste IPs (one per line) and click <strong>Add<\/strong><\/li>\n<\/ol>\n<p>CSF uses <code>\/etc\/csf\/csf.deny<\/code> as its persistent deny list. You can edit this file directly to add multiple IPs at once, which is useful when importing a blocklist of known bad actors.<\/p>\n<h2>Identifying Which IPs to Block<\/h2>\n<p>Knowing <em>which<\/em> IPs to block is half the battle. cPanel provides several tools to help identify problematic addresses:<\/p>\n<h3>Check Apache Access Logs<\/h3>\n<p>In cPanel&#8217;s <strong>Metrics<\/strong> section, open <strong>Awstats<\/strong> or <strong>Analog Stats<\/strong> to spot patterns. Look for:<\/p>\n<ul>\n<li>Hundreds of requests from the same IP in minutes<\/li>\n<li>Repeated 404 hits (scanners looking for vulnerable paths)<\/li>\n<li>Failed login attempts from unfamiliar locations<\/li>\n<\/ul>\n<h3>Review the cPanel Login Failure Log<\/h3>\n<p>Go to <strong>Login Failure Log<\/strong> in the Security section. If you see the same IP address attempting to log into cPanel repeatedly, block it immediately. These are typically brute-force bots trying common passwords.<\/p>\n<h3>Monitor Email Authentication Failures<\/h3>\n<p>Check your email logs for repeated SMTP authentication failures from the same IP. Attackers often try to brute-force email accounts to send spam. The <strong>Mail Log<\/strong> tool in cPanel&#8217;s Email section can help identify these patterns.<\/p>\n<h2>Automated IP Blocking with cPHulk<\/h2>\n<p>cPanel includes <strong>cPHulk Brute Force Protection<\/strong>, which automatically blocks IPs after repeated failed login attempts. This is your first line of defense and should always be enabled.<\/p>\n<h3>Configuring cPHulk<\/h3>\n<ol>\n<li>In WHM, search for <strong>cPHulk Brute Force Protection<\/strong><\/li>\n<li>Enable it for both cPanel login and SSH login (if available)<\/li>\n<li>Set the failure threshold \u2014 5 failed attempts within 15 minutes is a good starting point<\/li>\n<li>Set the block duration \u2014 24 hours is reasonable for most servers<\/li>\n<li>Add your own IP to the <strong>whitelist<\/strong> so you never lock yourself out<\/li>\n<\/ol>\n<p>cPHulk maintains its block list in <code>\/var\/cpanel\/cphulk\/blockedips.txt<\/code>. You can review or manually clear entries from this file if needed. The system automatically unblocks IPs after the configured duration expires.<\/p>\n<h2>Best Practices for IP Blocking in cPanel<\/h2>\n<p>Effective IP blocking goes beyond just adding addresses to a list. Follow these guidelines to keep your server secure without accidentally blocking legitimate traffic:<\/p>\n<ul>\n<li><strong>Always whitelist yourself first.<\/strong> Before blocking any IPs, add your own IP address to the CSF whitelist (<code>\/etc\/csf\/csf.allow<\/code>) to avoid locking yourself out.<\/li>\n<li><strong>Use temporary blocks initially.<\/strong> Start with a 24-hour block rather than permanent. If the IP continues causing issues after the block expires, then make it permanent.<\/li>\n<li><strong>Block at the correct layer.<\/strong> Use cPHulk for login failures, the IP Blocker for server-wide access issues, and ModSecurity for application-layer blocks. Each tool is optimized for its purpose.<\/li>\n<li><strong>Maintain a blocklist log.<\/strong> Document why each IP was blocked and when. This helps with troubleshooting if a legitimate user gets blocked by mistake.<\/li>\n<li><strong>Review blocked IPs monthly.<\/strong> Attackers change IPs frequently. Regularly reviewing your blocklist removes stale entries and keeps your firewall rules efficient.<\/li>\n<li><strong>Combine with rate limiting.<\/strong> Use CSF&#8217;s connection tracking to limit how many connections a single IP can make per second, which mitigates DDoS attacks without hard-blocking the IP.<\/li>\n<\/ul>\n<h2>Key Takeaways<\/h2>\n<ul>\n<li>cPanel&#8217;s IP Blocker is the quickest way to deny specific IPs or ranges \u2014 accessible from the Security section of your dashboard<\/li>\n<li>CSF provides more advanced control including temporary blocks, CIDR notation, and command-line management for power users<\/li>\n<li>cPHulk automates IP blocking after repeated failed login attempts and should be enabled on every cPanel server<\/li>\n<li>ModSecurity offers application-layer IP blocking that can be restricted to specific domains or URLs<\/li>\n<li>Always whitelist your own IP before implementing blocks to prevent accidental lockouts<\/li>\n<li>Regularly audit your blocklist and use temporary blocks when possible to adapt to changing attacker IP addresses<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Why IP Blocking Matters for Your cPanel Server Every day, automated bots, brute-force attackers, and malicious scanners probe cPanel servers looking for vulnerabilities. Without proper IP blocking, your site wastes resources handling unwanted traffic and risks unauthorized access. cPanel provides built-in tools to block specific IP addresses or entire ranges at the server level \u2014 &#8230; <a title=\"How to Block IP Addresses in cPanel: IP Blocker, CSF, and cPHulk Guide\" class=\"read-more\" href=\"https:\/\/cpanelreview.com\/index.php\/2026\/05\/03\/block-ip-addresses-cpanel-ip-blocker-csf-cphulk\/\" aria-label=\"Read more about How to Block IP Addresses in cPanel: IP Blocker, CSF, and cPHulk Guide\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[147],"tags":[150,148,152,151,149],"class_list":["post-59","post","type-post","status-publish","format-standard","hentry","category-security","tag-block-ip-address-cpanel","tag-cpanel-ip-blocker","tag-cpanel-security-guide","tag-cphulk-brute-force-protection","tag-csf-firewall-cpanel"],"_links":{"self":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/posts\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":0,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/posts\/59\/revisions"}],"wp:attachment":[{"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/media?parent=59"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/categories?post=59"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cpanelreview.com\/index.php\/wp-json\/wp\/v2\/tags?post=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}