Would you like to learn how to deny access to the IIS server for an IP address? In this tutorial, we will configure the IIS server to block access from a list of IP addresses.
• Windows 2012 R2
• Windows 2016
• Windows 2019
Equipment list
The following section presents the list of equipment used to create this tutorial.
As an Amazon Associate, I earn from qualifying purchases.
Windows Tutorial:
On this page, we offer quick access to a list of Windows tutorials.
Tutorial IIS – Blocking an IP address
On the server manager, enable the IIS security feature named IP and domain restrictions.
Start the application named: IIS Manager.
On the IIS Manager application, select your website.
On the right part of the screen, access the option named: IP address and domain restrictions.
On the top right part of the screen, click on the Add deny entry option.
To deny access to a single IP address, perform the following configuration:
• SPECIFY THE IP ADDRESS – Yes
• VALUE – Enter the desired IP address.
Click on the OK button.
To deny access to a range of IP addresses, perform the following configuration:
• IP ADDRESS RANGE – Yes
• VALUE – Enter the desired IP network.
• MASK OR PREFIX – Enter the desired network mask.
Click on the OK button.
Optionally, use the command-line to restrict access from an IP address.
In our example, we denied access to a website based on the source IP address.
To test the installation, open the Chrome browser on a remote computer and try to access any page.
In our example, the following URL was entered in the Browser:
• http://192.168.0.10
The system will deny access based on the source IP address of the request.
Optionally, you may use the CURL command of a Linux computer to test the header configuration.
Here is the command output.
Congratulations! You denied access to an IIS website based on the source IP address.