I have an AWS web server - call it box.company.com. It's running IIS and if I visit http://box.company.com in a web browser (from any machine, including box.company.com), it responds correctly with our site. However, if I visit localhost/ or when I'm logged into box.company.com, I get a "couldn't connect to host" message.

The hosts file has only one entry - the standard " localhost" line. Pinging works fine. Pinging localhost correctly resolves to and works fine.

I've tried restarting IIS and restarting the DNS Cache. I had this problem once before, and restarting the server fixed it, but I'd like to know what's going on in case this happens again in the future.

  • A couple updates. The site also stopped responding to box.company.com locally. Restarted and now everything works again. – Jordan Jun 27 '11 at 16:10

What's the IIS site's binding config look like? What this sounds like is that it's configured to listen on a specific IP (or all IPs with a specific host header), to the exclusion of localhost.

  • Not really sure how to format this, but... (dash means the column is empty) (Type,Host Name,Port,IP,Binding Info) [http,-,80,,-],[https,-,8443,,-],[net.tcp,-,-,-,808:*],[net.pipe,-,-,-,*],[net.msmq,-,-,-,localhost],[msmq.formatname,-,-,-,localhost] For what it's worth, this is the same as the config on another one of our machines that doesn't have this problem – Jordan Jun 27 '11 at 15:56
  • Don't place it in a comment to an answer. It's information that is part of the question. Edit it into your question. Then you'll be able to format it. – JdeBP Jun 28 '11 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.