In this article, I’ll show you how to block specific IP addresses from accessing IIS websites or applications running on IIS 10 and Windows Server 2016.
Sometimes you would like to block a specific IP address that may be spam you or try to harm your website, blog or application to contact IIS.
Luckily, IIS has a great module that doesn’t get Installed by default that will allow us to block a specific IP address, IP range or only allow specific IP address to access the site.
To get started, you will need to Install Web IP Security module using PowerShell add roles and features (I’ll use PowerShell).
The Install will take one minute to complete without needing to restart the Server.
Once done, You will see the IP Address and Domain Restrictions Module In the center panel of the Website In IIS
As you can see below, you have two options create an allowed list only or a block list.
In my case, I just want to block a specific IP that spamming my Website so I’ll select Add Deny Entry
I can either add one address or a range
To allow only I could select Allow
Once added, the address will appear in the main list