How do I block an IP address, through IIS, from viewing a website on my server?

The following article details how you can block IP addresses from viewing your website. Blocking IP addresses prevents users from seeing your website during construction, limits access to specific users, or to blocks users attempting to connect to your site maliciously. If necessary, you can also grant access to specific IP addresses.

To block an IP address from viewing your website, please follow these steps:

  1. Log into your server through Terminal Services or Remote Desktop Connection.
  2. Click Start, select Programs, and then click Administrative Tools.
    • For IIS 5.0 click Internet Services Manager.
    • For IIS 6.0 click Internet Information Services.
  3. In the left column you will see the Server Name.
    • In IIS 5.0, expand the Server Name to find the domain name.
    • In IIS 6.0, expand the Server Name and then Web Sites to find the domain name.
  4. Right-click on the domain name and select Properties.
  5. On the Directory Security Tab under IP Address and Domain Name Restrictions click Edit.

You have two options, you can grant access to all computers and restrict individual IP's or you can deny access to all computers and grant access to specific IP's. By default, all users will be granted access to your site except the IP addresses you specify.

To add an IP address to the restriction list, please follow these steps:

  1. Click Add.
  2. Select the type:
    • Single Computer - add a single IP Address.
    • Group of Computers - add a block IP Address using the starting IP address of the block and the appropriate subnet mask.
    • Domain Name - add a domain name (this method is not recommended).
  3. Click Ok.