.png&w=3840&q=75)
Websites & Hosting4 min
How to Block Malicious IP Addresses Using cPanel
NS
NameSilo Staff8/19/2026
Share
To block malicious IP addresses using cPanel, log into your hosting dashboard and navigate to the IP Blocker tool under the Security section. Enter the specific IP address, IP range, or CIDR block of the attacker, and click Add. The server will automatically deny all web requests originating from those addresses, protecting your site from brute-force attacks.
What Is Server-Level IP Denial?
The cPanel IP Blocker, also called the IP Deny Manager, is a visual form that writes access-control rules directly into your site's .htaccess file. There's no firewall configuration and no command line, just a form that generates the rule for you.
Behind the scenes: Every entry becomes a Deny from [IP] line (or the newer Require not ip syntax on Apache 2.4 servers) written into .htaccess. Apache reads this file before serving any content, so a blocked IP gets rejected before your site even loads.
Scope note: On shared hosting, this block applies globally across every domain in your cPanel account, not just the site where you added it.
Why It Matters: Stopping Bots Before They Exhaust Resources
An automated credential-stuffing bot attempting 5,000 fake logins an hour isn't just a security risk, it's a resource drain. Each failed login still consumes CPU cycles, database queries, and bandwidth, before the attacker gets anywhere near a real account.
Blocking the source IP stops the drain immediately, rather than relying solely on rate-limiting or password policy after the attack is already consuming resources.
Diagnosing the Threat: Finding the Offending IPs
Before blocking anything, confirm who's actually attacking.
AWStats: cPanel's built-in traffic analyzer shows request volume by IP. A single address generating thousands of hits in a short window is an obvious flag.
Raw Access Logs: For more precision, download the raw logs (cPanel → Metrics → Raw Access) and search for repeated POST requests to your login page or wp-login.php, a classic brute-force signature. The same IP appearing dozens of times per minute is your target.
Implementation Steps
Step 1: Log into cPanel and go to Security → IP Blocker.
Step 2: Enter the address to block. Formats accepted:
- Single IP: 192.168.0.1
- IP range: 192.168.0.1-192.168.0.100
- CIDR block: 192.168.0.0/24
Step 3: Click Add. The rule writes to .htaccess instantly.
Step 4: Verify the block by checking your raw access logs a few minutes later, requests from that IP should stop appearing.
Step 5: To remove a block later, return to IP Blocker, find the entry, and click Delete. cPanel removes the corresponding line from .htaccess automatically.
Common Mistakes
Blocking your own office or home IP by mistake: This is the single most common IP Blocker error. Confirm your current IP before adding any block, and double-check the address you're entering matches the attacker's log entry exactly, not your own session.
Mixing old and new Apache syntax: Newer cPanel servers running Apache 2.4 use the Require directive instead of the legacy Order/Deny syntax. If you manually edit .htaccess alongside using the IP Blocker tool, mixing both syntaxes in the same file can cause a 500 error across your entire site.
Blocking a CDN or proxy IP instead of the real attacker: If the attacker routes through a VPN or shared proxy, the IP you block may also serve legitimate visitors, or worse, may not even be the attacker's real address.
What This Means for You
NameSilo Hosting includes full cPanel access, giving you direct use of IP Blocker for shared hosting environments where server-level firewall access isn't available. For sites facing persistent or large-scale attacks, layering IP Blocker with a web application firewall adds another line of defense.
Frequently Asked Questions
How do I block an IP address from my website?
cPanel → Security → IP Blocker → enter the IP → click Add.
Where is the IP Blocker in cPanel?
Under the Security section on the main cPanel dashboard.
Can I block a whole country in cPanel?
Not directly; you'd need to block the relevant CIDR ranges manually.
How do I find out who is attacking my server?
Check AWStats or raw access logs for repeated requests from one IP.
What does an IP blocker do?
Writes deny rules into .htaccess to reject requests from specified IPs.
Does blocking IPs in cPanel update the htaccess file?
Yes, automatically, the moment you click Add.
How do I unblock an IP address?
IP Blocker → find the entry → click Delete.
Does NameSilo hosting provide DDoS protection?
NameSilo hosting includes standard infrastructure protections; IP Blocker adds manual control.
.png&w=2048&q=75)
NameSilo StaffThe NameSilo staff of writers worked together on this post. It was a combination of efforts from our passionate writers that produce content to educate and provide insights for all our readers.
More articleswritten by NameSilo

.png&w=3840&q=75)
.png&w=3840&q=75)