Fixing Listen IPs In IIS (The network location cannot be reached)

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, May 23, 2011

Follow me on Twitter as @mattiasgeniar

When you run IIS sites long enough, you might eventually run into the following problem when trying to start a new or already existing site in the IIS manager.

Error: "The network location cannot be reached. "

The most likely cause is that Host Headers for that particular site are configured for an IP address which is either no longer configured on the server, or on which IIS is no longer listening. I’m just going to assume you know how to check if an IP is configured on a server.

To check whether IIS service is listening on a particular IP, you’ll need the Windows Server Support Tools (hit google for another version if you should need it). After the installation, can you use the following Command Prompt tools.

> httpcfg query iplisten
IP                      : 10.1.5.200

If your IP address isn’t present, try adding it.

> httpcfg set iplisten -i 10.1.5.201
HttpSetServiceConfiguration completed with 0.

And query the list again.

> httpcfg query iplisten
IP                      : 10.1.5.200
------------------------------------------------------------------------------
IP                      : 10.1.5.201
------------------------------------------------------------------------------

If it does not work after the httpcfg change, you may have to reboot your server (I know, it sucks). For some reason, restarting IIS alone may not always help.

A very likely cause is that something else was occupying port 80 already when the IIS service started, causing it to delete that particular listen IP from it’s configuration. To track that down, use netstat.

> netstat -anb | find "80"

That will list all connections or programs listening to port 80.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.