Friday, July 27, 2007

Bind IIS to an IP address

Let's say you want IIS 5.0 not to bind to 0.0.0.0 and want it to bind to a specific IP address. You can go to Administrative Tools->Internet Information Services, and then to "server name"->Web sites->Default Web site, right-click, properties, go to the 'Web Site' tab, and in 'Web Site Identification' put the IP address you want IIS to bind to or click the 'Advanced' button to select more than one IP.



And you are all set... well... you are not :). IIS implements something called 'Socket Pooling' and if you have this enabled it basically makes IIS bind to all available IP addresses. So even when you go to the GUI and change the IP you want IIS to bind to, IT DOESN'T WORK. In order to make it work, you need to disable 'Socket Pooling', and you can do so with the following command:

script adsutil.vbs set w3svc/disablesocketpooling true

I just thought this was amusing and decided to make a post :). Something similar occurs with IIS 6.0 but I have not tried it yet. You can get more information here:

IIS 5.0:

IIS Binds to All Available IP Addresses When It Starts

How to Disable Socket Pooling


IIS 6.0:

IIS 6.0: Setting Metabase Property DisableSocketPooling Has No Effect

1 comment:

Anonymous said...

This is great stuff man!!!

Really you saved my day!! Thanks a lot man...!
tc