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.

At home I have a simple network setup conatining 2 machines and 1 belkin router.

On one machine i have a site hosted with IIS7. Rather than the standard localhost/index.htm address I have added an entry in the HOSTS file pointing the local ip (127.0.0.1) to this domain - www.mysite.dev.

I can access the site with www.mysite.dev with no problem.

Ahat I would like to do is be able to view this site from my other machine on the network.

Initially I assumed this could be done with a url like so MACHINE-NAME/www.mysite.dev, but the connection always times out. But I can ping MACHINE-NAME without problems.

For testing purposes I have disabled the windows firewall on both machines but to no joy.

Like a typical web developer, my techy/network skills are pretty poor.

Can anyone see where I'm going wrong ??

share|improve this question
    
I can't re-tag this myself, but "home-networking" should be "home-network" –  William Feb 22 '10 at 1:03

4 Answers 4

up vote 1 down vote accepted

On the Web Server, make sure you've created Web Sites in IIS and that they have different host headers (click on Advanced and you'll see where you can add them). For site #1, put mysite1.com, for site #2, put mysite2.com or whatever.

Now on your workstation, edit your hosts file (C:\WINDOWS\system32\drivers\etc\hosts) and add your web sites and IP address pairs like such:

192.168.2.3       mysite1.com
192.168.2.3       mysite2.com
share|improve this answer

It sounds like MACHINE-NAME is not resolving to an IP address correctly from the other machine. Your easiest option is to add the IP address of the web host into the local hosts file of the other machine.

To find out the IP address of the web server, open a command window (eg enter "cmd" in the "search programs" Start Menu box) and enter ipconfig.

Your entry might look like: 192.168.0.10 www.mysite.dev

Then you would just enter "http://www.mysite.dev" in the browser of the other machine.

If you are using different host header entries in IIS then you need to put these host headers into the other machine host file too, if you want to access them.

Cheers

share|improve this answer
    
Ok ive tried your suggestion. What I did was get the IP address if my server, I checked the ipconfg but couldn’t see an ip other than my router, so I did an online ip lookup Then on the other machine in the host file I put... IPADDRESS mysite.dev When I enter mysite.dev in the browser I get a “cannot connect message”, ive turned off all firewalls but no joy. Is there anything I need to change on my router settings? –  Truegilly Feb 22 '10 at 22:29
    
ok sorry, now i have the LAN IP of my PC with IIS, but by using that in the hosts file of the other machine it still doesnt work? :( –  Truegilly Feb 22 '10 at 22:42
    
A bit odd. If you put the LAN IP of the IIS host into the browser on the other PC, can you get to the site? Eg browsing to 192.168.0.x That might get you to the site or just to the IIS default home page if a host header is expected for the mysite.dev site. You should not need to change any router settings. You shouldn't need to change or disable Windows firewalls either. What version of IIS, and what versions of Windows on each machine? And is host header expected in the IIS site properties? While you are there, also confirm that the site is using http on the default port 80. –  William Feb 23 '10 at 3:50
    
hello, ok im still trying to get this working :( - the LAN ip of my server that hosts the sites in 192.168.2.3, 192.168.2.1 is the LAN ip of my router. now it seems that everyone is saying that by entering 192.168.2.3/domain should work, but all i get is a HTTP Error 404. The requested resource is not found. ive turned both firewalls off on both machines and still no joy. what i have done is entered in the hosts file on the server machine 127.0.0.1 mydomain.dev so i can access it using mydomain.dev on the local machine. can anyone see where the issue may be ?? :( –  Truegilly Feb 27 '10 at 17:47

The other option is to also add the host headers into the IIS configuration and assign multiple internal IP's and bind the sites to these IP's.

Editing C:\WINDOWS\system32\drivers\etc\hosts to point the sites to the machine is also an option.

share|improve this answer

ok this is odd. ive managed to fix it

in the host file of the other machine i entered this

192.168.2.1 mysite.dev

192.168.2.1 is the ip address of my router not the PC hosting IIS7, the LAN ip of that machine is 192.168.2.3 can anyone say why this has worked, im very confused ???

truegilly

share|improve this answer

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.