Managing IP Blocking in DirectAdmin
53 vues
Security & SSL
<h3>Blocking and Unblocking IP Addresses</h3>
<p>DirectAdmin provides tools to block specific IP addresses from accessing your hosting account. This is useful for preventing brute-force attacks, stopping spammers, or restricting unwanted traffic to your website.</p>
<h3>Blocking an IP Address via .htaccess</h3>
<p>The most common way to block IPs at the website level is through the <code>.htaccess</code> file in your <code>public_html</code> directory:</p>
<pre><code># Block specific IPs
order allow,deny
deny from 192.168.1.100
deny from 10.0.0.0/24
allow from all</code></pre>
<p>For Apache 2.4+ syntax:</p>
<pre><code><RequireAll>
Require all granted
Require not ip 192.168.1.100
Require not ip 10.0.0.0/24
</RequireAll></code></pre>
<h3>Using DirectAdmin's IP Deny Manager</h3>
<ol>
<li>Log in to DirectAdmin and go to <strong>Advanced Features → IP Deny Manager</strong> (also listed under the domain settings area).</li>
<li>Enter the IP address or CIDR range you want to block (e.g., <code>192.168.1.100</code> or <code>10.0.0.0/24</code>).</li>
<li>Click <strong>Add</strong> to apply the block.</li>
</ol>
<h3>Unblocking an IP Address</h3>
<ol>
<li>Navigate to the same <strong>IP Deny Manager</strong> page.</li>
<li>You will see a list of currently blocked IPs.</li>
<li>Select the IP address you wish to unblock.</li>
<li>Click <strong>Remove Selected</strong> or <strong>Delete</strong>.</li>
</ol>
<div class="alert alert-warning"><strong>Caution:</strong> Be careful not to block your own IP address. If you accidentally lock yourself out, contact your hosting provider to have the block removed from the server side.</div>
<h3>Server-Level Blocking (Admin Only)</h3>
<p>Server administrators can use the firewall (CSF/LFD or iptables) to block IPs at the network level, which is more effective than <code>.htaccess</code> blocks because the connection is refused before the web server processes the request. If you are experiencing a sustained attack, contact your hosting provider to apply server-level blocks.</p>
<h3>Checking Your IP</h3>
<p>Before blocking IP ranges, verify your own IP by visiting a service like <a href="https://whatismyip.com" target="_blank">whatismyip.com</a> to ensure you do not accidentally block yourself.</p>
Besoin d'aide ?
Vous ne trouvez pas ce que vous cherchez ? Notre équipe de support est prête à vous aider.
Contacter le support