Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm I bit of an IIS / Web noob (I'm a C# backend service / winforms dev) so please bare with me :-)

I've set up a site in IIS on my local dev machine.

In the bindings section of the site ive added 4 bindings, all 4 for http:

Host Name                   Port    IP Address
blog.sourcecube.co.za       26581   *
www.blog.sourcecube.co.za   26581   *
blog.sourcecube.co.za       26581   127.0.0.1
www.blog.sourcecube.co.za   26581   127.0.0.1

in my hosts file (drivers\etc\hosts), i've added the folling entries:

127.0.0.1   blog.sourcecube.co.za
127.0.0.1   www.blog.sourcecube.co.za

when i ping my domain name from the command line it does in fact resolve to the loopback address, 127.0.0.1.

So what I'm expecting to happen when i navigate to blog.sourcecube.co.za in my browser is for it to resolve to 127.0.0.1, and when the request hits IIS, it should know which site to serve because of the host header?

But when i navigate to blog.sourcecube.co.za, i get an "Unable to connect, Firefox can't establish a connection to the server at blog.sourcecube.co.za" error.

What am I doing wrong?

--- UPDATE ---

Navigating to blog.sourcecube.co.za:26581 from my browser works... I'd like get it working without specifying the port number though.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

is the port your mentioning above, the actual port that IIS is listening on? If so, make sure you're entering http://blog.sourcecube.co.za:26581

Your understanding is spot on, so I'm not sure why it would work. What is the specific number error you get? Is it 404, or is it a 500 error?

Edit 1: Pretty simple then, just set your IIS sites to port 80 on any ip address :) Host headers will then take care of the rest. 80 is implied when entering "http", so users wouldn't need to add the port at the end.

See the link below http://support.microsoft.com/kb/308163

IP Address TCP Port Host Header Name

192.168.0.100 80 www.example1.com 192.168.0.100 80 example1.com

share|improve this answer
    
I was just about to come update, when I navigate to blog.sourcecube.co.za:26581 (yes its the actual port ive configured) it works. But id like it to work without specifying the port number... Firefox doesn't give an error code, neither does IE, just says "Internet Explorer cannot display the webpage" –  HarveySaayman Apr 8 '12 at 18:31
    
see my comments –  Eric C. Singer Apr 8 '12 at 19:29
    
That worked! :-) –  HarveySaayman Apr 8 '12 at 19:49
    
I was not aware that i could configure multiple sites to use port 80. Thanks Eric! –  HarveySaayman Apr 8 '12 at 19:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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