A http server hosts several domains,for example, www.example1.com, www.example2.com, and www.example3.com. But there is only one IP address. So the three domains correspond to the same IP address.
The problem is, if I enter www.example1.com into my browser address bar and hit “go”, first thing, this domain name will be resolved to an IP address, and then my computer just uses this IP address(plus a default TCP port 80) to fetch a web page. I very much know that different domain name will get different page. But how can the three domain name here be differentiated since they corresponds to one IP address?
I am very much confused by this problem and hope some tech-savvy persons can give me a clear explanation. Thank you very much indeed!
Next: Free Or Good Website Hosting Tools?
Previous: I Want Some Help With A Domain Name For My Website?
"How Can Serveral Domain Name Be Differentiated Which Being Accessed Since They Belongs To One Ip Address?" was posted on Saturday, January 30th, 2010 at 8:24 am.
When you send a request for a website, for example http://www.fakedomain.com, the name of the domain you are requesting is included in something called a “host header.” The server that receives the request looks at this host header and is able to display the site corresponding to that information. This is called Virtual Hosting. The web server software is able to assign multiple domain names to one single IP address. The host header is what allows this to happen.
First, when your browser requests a web page, the Domain Name Server returns the I.P. address of the web server.
Your browser then requests the particular web page from the web server. Now the web server has information about the default folder for each domain name.
For example, say http://www.A.com and http://www.B.com use the same I.P. address. When you request A, the web server will look for the file in the public_html/A/ folder (for instance).
In a nutshell, the web server knows which is the root folder for the domain name and it resolves paths in web pages accordingly.