Server Fault is a question and answer site for system and network administrators. 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 want to know how a web server can distinguish between requests of different DNS names on the same server (same IP)?

for example, in my university there are two websites:

and when I use nslookup on Windows, I got the same IP address for both domain names. Can you explain please?

share|improve this question
up vote 8 down vote accepted

HTTP 1.1 requires that all client systems send a header, Host, which indicates to the server which hostname they are sending the request for.

This allows the server to read that header, and respond with content for the appropriate site.

Without this feature, a different IP address would be needed for each different site; we would have run out of IPv4 space even sooner if we didn't have this in place.

share|improve this answer

Fire up your favourite packet tracer (something like wireshark) and watch what actually happens when you connect.

A very simple request might look like this:

GET / HTTP/1.1

(note the empty line at the end if you want to re-create this yourself by using, say, telnet. You can see a lot of this stuff also over in wikipedia)

The Host: part of the request tells the web server which site to access.

There's a lot of stuff shown in these headers, so you might want to get to know them with a browser plugin like Firebug

share|improve this answer


Since a long tim, every HTTP request.... ...INCLUDES THE DOMAIN.

Basically the PAYLOAD (not tcp, the http request structure) tells the web serve rwhat the domiain is for.

has the fields transmitted by the browse. There is one "HOSTNAME".

Most other protocols - do not care.

share|improve this answer
is English your first language? – Alnitak Jan 10 '12 at 9:47
No. Simlpe like that. – TomTom Jan 10 '12 at 10:13

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.