HostGator.com » Support Portal



How do I deny IP address access?

Do you want to stop someone from visiting your website? This tool will block anyone from a specified IP address.

How to find out a visitor's IP address

Use the web statistics tools to find more information on your visitors. We suggest you go to cPanel and click the Latest Visitors icon. Look for the Host information; it could be an IP or a domain name.

How to block the IP address

  1. Login to cPanel and click IP Deny Manager.
  2. Under "Add an IP to deny", please enter IP address or domain name you wish to block.
  3. Click the Add button.

How to unblock the IP address

  1. Login to cPanel and click IP Deny Manager.
  2. At the bottom, under "Current IP addresses being blocked", click Remove.

Deny All

You can also set an option for deny from all, which will deny everyone.

This must be done by coding your .htaccess file as follows:

deny from all
allow from 70.24.291.52
allow from 216.130.49.223 #my house

See the article on How to Edit Your .htaccess File for generic instructions that apply to all .htaccess changes.

Important Note: It is possible to block access to yourself accidentally by using this method.

Be sure to allow access via your IP otherwise you will be blocked as well. You can find out your current IP address by visiting the What is your IP? page. If you accidentally block yourself, please contact HostGator via live chat or telephone. You will need to confirm your identity ("verify your account") before we can unblock your IP.


cPanelcPanel is a popular web hosting control panel that helps you manage your hosting account and assists you in creating web sites, managing e-mail addresses, & installing applications to a server.

cPanel is available on all HostGator Linux hosting plans, including Shared Hosting, Reseller Hosting, VPS and Linux Dedicated Servers.

Article Comments

Michael Thrasher
How do I block an IP from all sites under my reseller hosting?

HostGator
You will need to do this for each cPanel, individually.

Jim Carroll
Can I change the 403 message?
I would like to add...

Permission to access the site will be restored after you call 800-xxx-xxxx and explain your recent activities on the site.

HostGator
Yes, read the related article called "Custom error pages".

Steve
How can I deny a direct access to IP address -> aa.aa.aa.aaa opens currently the root, which should be only accessible via URL. I am using a dedicated server on HostGator

HostGator
Please email support@hostgator.com for help with your question.

GHAZ
Dear hostgator i want to block a specific ip adress from my website http://www.enjoymp3.co.cc ... but i couldn't find any ip adresses in latest visitors.. please suggest me how i can do that

thanks

HostGator
Take a look at http://support.hostgator.com/articles/getting-started/general-help/apache-mod_rewrite-and-examples

Use the last example for "Block traffic from multiple referrers".

Walter
In my hostgator IP deny manager. I have three instances of :

Server Setting: All | Beginning IP: All - Ending IP: All.

I don't know how long it's been that way, I've had this account for years and that's the first time I've looked in the IP deny mananger. Try to delete it looks successul, but I when I "Go Back" - all three are still there. All of the sites on the account work. Is this a problem?

HostGator
This is normal. That is just how it looks in cPanel.

HostGator
Thank you for your comments. Just a quick reminder that the comments on this page are not monitored by technical support staff, and that for support issues, it is best to contact us by live chat, phone or email so we can assist you right away.

Although comments are not monitored by technical support staff, they are moderated and read by technical writers. Comments will need to be approved by a moderator before appearing.

Our technical writers do read the comments periodically for the purposes of updating the articles, and do appreciate your feedback, suggestions and corrections to the articles themselves, as well as any suggestions or tips for readers of this article. However, support questions posted here are not guaranteed to be replied to in a timely manner or at all. For support issues, it is best to contact our support staff instead by live chat, email or phone.



Your comments help us keep the knowledge base updated. This is not a medium for support. If you have questions or need help, please contact us via email, phone or live chat for fast assistance.

Post Comment