Search Our Database

How To Configure IIS To Listen On Specific IP Address

Last updated on |

Introduction

Configuring IIS to listen on specific IP addresses can help enhance security and manage network traffic more efficiently. By default, IIS listens on all available IP addresses, but you can customize this to restrict it to certain IPs. This guide will walk you through the process of configuring IIS on various Windows Server versions to listen on specific IP addresses.

Windows Server 2008 / IIS 7

Step-by-Step Guide

 

Step 1: Run command prompt and type “netsh”.

C:\netsh

 

Step 2: Type “http”.

netsh>http

 

Step 3: Enter the following command to display the list of IP addresses to listen on. If no IP addresses are displayed, IIS will listen on all IP addresses by default.

netsh http>show iplisten

 

Step 4: Use the command below to configure IIS to listen on a specific IP address. Replace 127.0.0.1 with the desired IP address and run the command again for additional IP addresses.

netsh http>add iplisten ipaddress=127.0.0.1

 

Step 5: If you need to delete an IP address from the list, use the following command.

netsh http>delete iplisten ipaddress=127.0.0.1

 

Step 6: Restart IIS to apply changes.

C:\iisreset

Windows Server 2012 / IIS 8 and Later Versions

Step-by-Step Guide

The steps for Windows Server 2012, 2016, 2019, and 2022 are similar to those for Windows Server 2008, with slight variations in accessing the Command Prompt and managing services.

 

Step 1: Open Command Prompt and Access netsh

  • Open Command Prompt: Right-click the Start button, select “Command Prompt (Admin)” or “Windows PowerShell (Admin)”.
  • Run netsh: In the Command Prompt, type netsh and press Enter.
C:\> netsh

Step 2: Switch to HTTP Context

netsh > http

Step 3: Display the Current List of IP Addresses IIS Listens On

netsh http> show iplisten

Step 4: Configure IIS to Listen on a Specific IP Address

netsh http> add iplisten ipaddress=127.0.0.1

Repeat for any additional IP addresses.

 

 

Step 5: Remove an IP Address from the List

netsh http> delete iplisten ipaddress=127.0.0.1

 

Step 6: Restart IIS to Apply the Changes

Use PowerShell or Command Prompt to restart IIS.

iisreset

 

Step 7: Verify the Configuration

netsh http> show iplisten

Conclusion

By following these steps, you can configure IIS on various versions of Windows Server to listen on specific IP addresses, enhancing your server’s security and performance. Regularly reviewing and updating these settings as your network configuration changes will help maintain optimal performance and security.