Unlike IIS6 in Windows Server 2003 which required httpcfg
for IP binding configuration, IIS7 automatically binds to all available IP addresses (0.0.0.0) by default. This behavior creates conflicts when you need to run other web servers (like Apache) on port 80 using different IP addresses.
Microsoft replaced httpcfg
with the more powerful netsh http
command in Windows Vista/Server 2008 and later. Here's how to view current bindings:
netsh http show iplisten
To make IIS7 listen only to specific IP addresses (e.g., 192.168.1.100):
netsh http add iplisten ipaddress=192.168.1.100
You'll need to restart the HTTP service afterward:
net stop http /y
net start http
For servers with multiple IPs where IIS should only respond to certain addresses:
netsh http delete iplisten ipaddress=0.0.0.0
netsh http add iplisten ipaddress=192.168.1.100
netsh http add iplisten ipaddress=192.168.1.101
Check active bindings with either of these commands:
netsh http show iplisten
OR
netsh http show urlacl
For those preferring graphical tools:
- Open IIS Manager
- Select your server node
- In Features View, open "Configuration Editor"
- Navigate to
system.applicationHost/sites
- Expand the site collection and modify bindings
If changes don't take effect:
- Ensure you're running Command Prompt as Administrator
- Check for residual
http.sys
configurations withnetsh http show servicestate
- Verify no other services are using port 80 with
netstat -ano | findstr :80
Unlike IIS6 in Windows Server 2003 where we used httpcfg
to manage IP bindings, IIS7 defaults to listening on all available IP addresses (0.0.0.0). This becomes problematic when you need to:
- Run multiple web servers (e.g., Apache + IIS) on the same machine
- Host services like VisualSVN Server on port 80
- Implement network isolation or multi-tenant hosting
The primary tool for IIS7+ binding configuration is appcmd.exe
. Here's how to list current bindings:
appcmd list site
To modify a site's binding (replace placeholders with your values):
appcmd set site /site.name:"YourSiteName" /+bindings.[protocol='http',bindingInformation='192.168.1.100:80:']
For modern Windows Server environments, PowerShell provides better control:
Import-Module WebAdministration
New-WebBinding -Name "Default Web Site" -IPAddress "192.168.1.100" -Port 80 -HostHeader ""
For infrastructure-as-code scenarios, directly modify applicationHost.config
:
<site name="Default Web Site" id="1">
<application path="/">
<virtualDirectory path="/" physicalPath="%SystemDrive%\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="192.168.1.100:80:" />
</bindings>
</site>
After making changes:
- Check active listeners:
netstat -ano | findstr :80
- Restart IIS:
iisreset /noforce
- Test connectivity:
curl -I http://specific-ip