Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web server (xampp) in a particular PC running on my LAN, and I added the following line in the 'hosts' file : mysite.

Then, in another PC connected to the LAN, I'm trying to acces the previous web server by typing 'http://mysite/index.php' on the web browser, with no luck. But if I type the IP from the server computer ( I am able to access the web site.

So, what should i configure so when i type 'http://mysite/index.php' I get the same result as http:// ??


share|improve this question

closed as off topic by Brent Pabst, HopelessN00b, Tim Brigham, Stefan Lasiewski, Oskar Duveborn Sep 5 '12 at 21:13

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

The hosts files is only for DNS look-ups made by the local machine it's self that that hosts file reside on. So adding an entry to hosts on one machine is useless when trying to reference that name mysite from another machine. – jwbensley Sep 5 '12 at 20:43
Is this a duplicate question? It seems like there should already be a canonical answer which explains the purpose of /etc/hosts and the meaning of . I cannot find such a question. – Stefan Lasiewski Sep 5 '12 at 20:45

You should modify the hosts file of the other computer (the one that's not running the web server). It should contain a line like this one: mysite
share|improve this answer

The reason this happens is that the host file only affects the computer it's on. You'll need to modify the host file of every computer on your network if you wish to access the site from those computers using this method.

You'll also want to reference the web server by the machine's actual IP ( when editing the host files of the other computers on your network. is a loopback that references your current machine.

share|improve this answer

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