Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. Join them; it only takes a minute:

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 am testing a website and have been asked to map a host name (the live website url) to an ip address in my hosts file. My understanding is that this means when I browse to the host name, instead of seeing the live site, I am redirected to the ip address it is mapped to (the test site). This all works fine and I see the test site, what I don't understand is why I see another different test site if i browse directly to the ip address? And if I have two host names mapped to the same url in my hosts file I can see a different site when I browse to each of the host names? How is this possible?

share|improve this question
up vote 2 down vote accepted

Web-servers use something called vhosts. The server separates sites on the hostname, this allows multiple websites to be hosted on a single IP. -> IP -> serve files from location: /disk/webserver/website1 -> SAMEIP -> serve files from location: /disk/webserver/website2

You can also setup the webserver to direct to a website when you have no hostname, when you access it directly onits IP.

http:// IP -> /disk/webserver/website3

share|improve this answer

Your Answer


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.