Where did my IIS7 server go? Troubleshooting "server not found" errors

Sometimes, after provisioning a new machine, or making some configuration changes, you may find that your IIS server has gone completely missing without so much as leaving you a note.  As you desperately try to bring up your site, your browser connection times out with “server not found” or, slightly better, you get the plain 503 “service unavailable” error.
 

In these cases, a lot of the instrumentation you typically have at your disposal with application failures is not available to help you fix the problem.  But, not to worry - the solution is usually only a few steps away.  The step-by-step instructions below should help you figure out what’s wrong in minutes.

First, let’s dissect the “server not found” error, which typically looks like this: 



Server Not Found

What is it?

This error means that your browser is unable to establish a connection to the web server at the specified address.
 

Why does it happen?

The first reason may have nothing to do with IIS - your browser may be unable to resolve the server hostname you specified, or the server is unreachable because of network connectivity or firewall related issues.  If that’s not it, IIS may not be running on the target server, and if it is, your site may be stopped due to configuration issues.

How do I get rid of it?

Lets get rid of it in 3 easy steps:

STEP 1: Make sure your client can resolve the hostname to an ip address and connect to the server. 

Test it can by running the following from command line:

NOTE: Here and below you need to use a command line window running as Administrator in order to execute the commands.  To get an elevated command line window, find it in your start menu, right click, and chose "Run as Administrator"

> ping www.mywebsite.com

If you are unable to resolve the hostname, then your problem is with your client’s proxy server, hosts file, or DNS server.  If you are unable to ping the target server, your problem may be with the client’s network connectivity to the server, or the firewall.


If you can access the server over the network, the second most likely reason is that IIS is not started, or is not listening for requests on the specified hostname/port combination.

STEP 2: Make sure IIS is started.

In order for IIS to accept incoming requests, the W3SVC service needs to be running.  Make sure it is by running the following from command line:

> net start w3svc

If you see the service start, then it was not previously started and you have the answer.  If however you see an error indicating that the service is already started, you may proceed to the next step.

STEP 3: Make sure that your web site is started and is listening to requests

A site has one or more network bindings, each defined by a combination of ip address, port, and hostnames on which the site should receive its requests.  Starting with Windows 2003, IIS uses the http.sys kernel driver to listen for requests, and the W3SVC service to configure it to listen for requests on all binding endpoints associated with your site.  On IIS7, the service doing most of the work is now called WAS (even though W3SVC is till needed).  A configuration error can cause WAS/W3SVC to fail to start a site, and therefore http.sys will not receive requests on its endpoints.  Also, there is the off chance that the site definition itself is missing, or the site does not define the right bindings.

There is a quick way to check whether the site is started, and what end-points its configured to run on, by running the following from command line:

> %windir%\system32\inetsrv\AppCmd.exe list sites

At this point, you may get a configuration error indicating malformed configuration in the sites section – in that case, you need to fix this to proceed.  Once the error has been fixed, the resulting output should include your site as follows:

SITE "Default Web Site" (id:1,bindings:http/*:80:,state:Started)


If you site is not listed, well, then you know the problem.  If the site definition does not contain the proper binding (in the form of protocol/[ip-address-list-or-*]:port:[host-header-list-or-blank]), then you need to add the missing binding.

If the state shows as Unknown or Stopped, then there is a configuration error that is preventing your site from being started.  Most of the time, the event log holds the key to the exact error. 

Start the event viewer (Start>Run>eventvwr.exe), and look for an error in the “System” event log under “Windows Logs”, with “WAS” as the event source.  You may see something like this:


Event 5161:

Site 1 has no root application defined, so the site will be ignored.


This should most of the time hold the key to what you need to do to make sure the site is valid.  The following may cause your site to not be valid:

  1. The site does not contain a root application (with path = “/”)
  2. The site does not contain a single valid binding
  3. A binding is invalid or conflicts with another binding on the machine

Once you’ve made the required configuration changes, you can start the site like this:

> %windir%\system32\inetsrv\AppCmd.exe start site "Default Web Site"


Where "Default Web Site" is replaced with the name of your site.


At this point, if your client can successfully connect to the server, IIS is started, and your site is started and is listening for requests, you should no longer be timing out with “server not found” errors when connecting to your site.

The next biggest “my server is gone” issue you may hit is the dreaded 503 “service unavailable” error, that looks like this:

Service Unavailable

To deal with this one, check out my other post about troubleshooting "service unavailable" errors.

Bonus: PortChecker tool

I put together a little tool that simplifies the initial check for site’s reachability before you go through the STEP 1 - 3 process to determine the root cause.  This tool tests TCP connectivity to the specific port on the target machine, something that the PING command cannot do.  You can use it to determine whether IIS is listening on a particular ip/port and whether you can get to it – or test connectivity to any arbitrary TCP services (since it will expose DNS, network connectivity, lack of active listening connections), such as SQL Server. 

>> Read more and get PortChecker here <<

 

Published 16 October 06 11:57 by Mike Volodarsky
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Jim Dobos said on May 1, 2007 8:34 PM:
Hi, I have tried the suggestions you have posted here, but I am not having much success. Everything was working fine until a trojan virus was downloaded along with tons of spyware. I finally removed all of it by using a battery of spyware removers. Now that the spyware is gone, I cannot access typical web pages. I am able to type in some web address and it will work ok. But, if I try to go to google.com, ms home page, ebay, facebook, etc., then the DNS Error or sever not found message comes up. It looks like it flashes that the site is found, but it redirects me to the infamous DNS error page. If I boot in safe mode, the system will allow me to access all web pages, including my home page.
# you've been HAACKED said on May 18, 2007 11:49 PM:

Service Unavailable Errors in IIS 7 Are Killing Me

# Community Blogs said on May 19, 2007 12:17 AM:

I am at my wits end trying to get IIS 7 to work on my Vista Ultimate box and I have tried everything

# JPA said on July 24, 2007 3:37 AM:
what about the "Internet Explorer can not display the page" IE7 message when you type in http://localhost/ ? any clues of what is needed to use the "localhost". 127.0.0.1 works fine ! "localhost" is needed by Web Development Tools like VisualStudio.
# Mike Volodarsky said on July 24, 2007 9:07 AM:

JPA,

What happens when you do "ping localhost" from command line?  If it doesnt resolve to 127.0.0.1, then you dont have the hosts entry configured correctly.  

Edit %windir%\system32\drivers\etc\hosts and add a line that maps localhost to 127.0.0.1 following the example in the file.

Thanks,

Mike

# Mike Volodarsky's ServerSide said on July 26, 2007 9:33 PM:

So you just moved your application to an IIS7 server, and now you are getting an error when you make

# Mike Volodarsky's ServerSide said on July 26, 2007 10:13 PM:

In the previous post, I covered the “server not found” error that is a common and frustrating problem that may occur for a number of reasons after a configuration change, or when deploying a new server machine. Another common “what the hell just happened”

# TonyWang said on July 28, 2007 6:32 AM:

IIS7逐渐向我们走来,功能丰富的同时也让排错的过程变得更加艰难。Mike Volodarsky的这篇Blog就一步一步地教会我们“像专家一样进行IIS7排错”的本领:) 这是一篇比较长的、图文并茂的文章,不难理解也非常实用,真正做到了“受人以渔”。

# ashleyg said on August 6, 2007 7:56 AM:
Hi there, I have a problem with my local web server. I am running on Vista with IIS 7 installed with full options currently. As I was testing my web pages on my local site, I encountered 404 problem. I then installed ASP and ASP.net for convenience and luck sake. Re-tried running dreamweaver to test my web page - A different error showed up: "An error occurred on the server when processing the URL. Please contact the system administrator" To be clear on the errors, the following addresses show the results: http://localhost/ => shows IIS 7 graphics http://localhost/myContacts/developers.asp => the error just mentioned above. Could someone please advise on to tackle this problem? My IT background is mediocre ;) Thank you. Ash
# ColSchmoll said on August 9, 2007 4:06 AM:
Hello, I can't connect to my localhost or 127.0.0.1 in IE on Vista Utlimate, I just get "Internet Explorer cannot display the webpage". When I run "%windir%\system32\inetsrv\AppCmd.exe list sites" it returns nothing. Can anyone help? I have the WWW service running and I can connect to external sites.
# jorge said on September 4, 2007 4:02 AM:
Mike, I always enjoy your posts, very helpfull. I have an issue with IIS7 not serving up images on localhost. When I push to domain, images are fine. on localhost, nothing. all else is good, just no images. TIA jorge
# mnkeyfeetz said on October 8, 2007 4:44 PM:
I needed a specific user account for application pools for my application, but apparently the WPG user is no longer used. I had to go into IIS and in the Application Pool area and manually change the Identity from SpecificUser to NetworkService. After that it worked fine...
# Mike Volodarsky said on October 13, 2007 1:05 PM:

ColSchmoll,

Did you install IIS from Turn Windows Features On or Off?

If you did, you'd have a "default web site" (unless you deleted it, in which case create a new website with "inetmgr.exe").

If you install it and it still doesnt work, use http://mvolo.com/blogs/serverside/archive/2007/07/26/Troubleshoot-IIS7-errors-like-a-pro.aspx to get the detailed error message.

Thanks,

Mike

# Steve Schofield Weblog said on November 1, 2007 12:53 PM:

I've been hanging in the forums and newsgroups. There have been a variety of posts stating, I can't browse

# IIS 7.0 Server-Side said on January 23, 2008 11:14 PM:

Due to demand for the original PortCheck tool , I decided to release the updated version that I myself

# Upgrade to Vista Ultimate said on March 14, 2008 9:02 AM:
I have tried many different things but stil cannot get IIS7 to work on Vista Ultimate. I am getting a 503 error and on checking the event viewer, this message:

'Cannot read configuration file ' trying to read global module configuration data from file '\\?\C:\Windows\system32\inetsrv\config\applicationHost.config', line number '0'. Worker process startup aborted.

Can anybody help. I've tried uninstalling & re-isntalling via the Turn Windows features on /off.

'Interestingly' I dont have a default website though and Im guessing I should because I havent deleted it manually. However this doesn't really help me solve the problem?

Can anybody help? I have noticed other posts with people having the exact same problem (after an upgrade aswell) but no solution.

Thanks Chris
# penis enlargement said on June 26, 2008 2:28 PM:

As reported last week, the Republican party is trotting out William Weld as a potential challenger to Eliot Spitzer in New York's 2006 gubernatorial election. Weld is the former governor of Massachusetts, but has little or no name (or face) recognition

# Eckmar Schmitz said on July 14, 2008 7:31 PM:
When installing IIS 7.0 under Vista Ultimate, I can't see any content from normal html pages. Aspx pages are working fine. I found this problem written in many forum but no solution were given. Thanks for answer mail@shees.de
# Prasanna said on August 27, 2008 11:44 AM:
Thank You So much. Actually my default web site was in the stopped state and I had it to start it. But I have a question, after the installation of IIS, why is the Default Web Site not started automatically?

Leave a Comment

(required) 
(optional)
(required) 
Enter the code you see below


About Mike Volodarsky

For the past 5 years, I was the core Program Manager for Microsoft ASP.NET 2.0 and IIS 7.0 products. I drove the design and development of the IIS 7.0 web server core, the IIS FastCGI support, the AppCmd command line tool, the ASP.NET Integrated pipeline, and other special projects around server security, performance, and scalability. Now, I am working on my own on cutting edge web server tech on top of the Microsoft IIS platform, and continue blogging about it here.

About me



For the past 5 years, I was the core server Program Manager for the IIS 7.0 and ASP.NET 2.0 products at Microsoft.
Now, I work on advanced web server tech using IIS 7.0, .NET, and Windows Server 2008 and write about it in this blog.

View Michael Volodarsky's profile on LinkedIn

Writings



TechNet Magazine
>Top 10 Performance Improvements in IIS 7.0

MSDN Magazine
>IIS 7.0: Build Web Server Solutions with End-To-End Extensibility
>IIS 7.0: Enhance Your Apps with the Integrated ASP.NET Pipeline
>IIS 7.0: Explore The Web Server For Windows Vista And Beyond
>Design and Deploy Secure Web Apps with ASP.NET 2.0 and IIS 6.0
>Fast, Scalable, and Secure Session State Management for Your Web Applications


Tools and Modules

LeechGuard
IconHandler 2.0
DirectoryListing
HttpRedirection
IIS Auth for Wordpress
iisschema.exe
PortCheck.exe v2.0

Popular Posts

- ASP.NET 2.0 Breaking Changes on IIS 7.0
- Develop IIS7 modules and handlers with .NET
- Troubleshoot IIS7 errors like a pro
- Troubleshooting 503 / "service unavailable" errors
- Troubleshooting "server not found" errors
- Create IIS7 sites, applications, and virtual directories
- Run Ruby on Rails with IIS FastCGI
- VS Debugging of ASP.NET applications on Windows Vista
- Stop hot-linking with IIS and ASP.NET

Tags

Search

Go

This Blog

Archives

Good IIS Blogs

Disclaimer

These postings are provided as is with no warranties, and confer no rights. The views expressed in this blog are entirely my own.

Syndication