Configure IIS 7 to Listen on Specific IP Addresses with Netsh

If you are trying to run multiple types of web servers on a single Windows server, you may have noticed that IIS locks onto all of the available IP addresses on the system by default.  You can easily remedy this from the command-line with the “netsh” utility.  Here’s what to do:

Open an Administrator’s Command Prompt and run the following, replacing “a.b.c.d” with the IP address you would like IIS to bind:

[cc]

netsh http add iplisten ipaddress=a.b.c.d

[/cc]

You do this for each of the IP addresses you would like to have IIS listen on.  Again, by default, IIS will listen on all IP addresses.  To verify how IIS is currently configured, use “netsh” as follows:

[cc]

netsh http sho iplisten

[/cc]

If there are no entries in the list, IIS is listening on all IP addresses.  If there are entries in the list that you would like to remove, run the following, replacing “a.b.c.d” with the IP addresses you don’t want IIS to listen on:

[cc]

netsh http delete iplisten ipaddress=a.b.c.d

[/cc]

You will need to reset IIS for the change in configuration to take effect. Here’s the reference for “netsh http” on TechNet:

http://technet.microsoft.com/en-us/library/cc725882(v=ws.10).aspx

Hope this helps!

This entry was posted in Apache, IIS, Microsoft TechNet, Windows, Windows 7, Windows Server 2008 R2, Windows Server 2012. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *