Devlico.Us
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @devlicious

Billy McCafferty



Prevent IIS from Binding to all Assigned IP Addresses

By default IIS binds (listens) to all IP addresses assigned to the server it's running on.  This is problematic when you'd like one or more of the IP addresses to be used by another application, such as a Ruby on Rails app running on Apache or, in my case, Mingle.  In these instances, it is desirable for IIS to bind to only one or more specific IP addresses while allowing the others to be free for use by other services.  To do so, you must explictly set IIS to listen on the IP address(es); doing so will automatically free all other IP addresses for other uses.  To explicitly add an IP address to the IIS IP Listen list:

  1. Ensure that you have the HttpCfg.exe utility installed onto the server.  If you're running Windows Server 2003, it'll automatically be available, but if you're running Windows XP you can download HttpCfg.exe as part of the Windows XP Service Pack 2 Support Tools.
  2. Open a command prompt and type the following, replacing ###.###.###.### with the IP address you'd like to add to the IIS IP Listen list:
    httpcfg set iplisten -i ###.###.###.###
  3. Upon success, it'll return the following confirmation:  HttpSetServiceConfiguration completed with 0.
  4. Restart the HTTP service.

After restarting the HTTP service, IIS will only bind to the IP address added to the IP Listen list.  You can use the HttpCfg utility to inform IIS to listen to more than one IP address as well.  If you want to see all IP addresses that IIS is listening to, simply run "httpcfg query iplisten" in a command prompt.

Billy McCafferty



Comments

Simone Busoli said:

Can't this be done via the IIS administration gui?

# September 3, 2008 3:28 AM

Billy McCafferty said:

Can it?  I haven't found a mechanism to do so, but I'd love to know if there is a way via IIS.

# September 3, 2008 7:30 AM

IHateSpaghetti {code} said:

Visual Studio Extensibility/ DSL Tools How to open files from the Output window - by Pablo How do I obtain

# September 3, 2008 1:00 PM

Arjan`s World » LINKBLOG for September 3, 2008 said:

Pingback from  Arjan`s World    » LINKBLOG for September 3, 2008

# September 3, 2008 4:37 PM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add
Check out Devlicio.us!

Our Sponsors

Red-Gate!