Mobile app version of vmapp.org
Login or Join
Samaraweera270

: How does multiple domains pointing to one IP address work I see this a lot and I'm not sure how it works, the mechanics behind it. I've been asked if it's possible to host two sites, on

@Samaraweera270

Posted in: #Dns #Domains

I see this a lot and I'm not sure how it works, the mechanics behind it. I've been asked if it's possible to host two sites, on the same Windows 2012 server on the same IP address but with different domains.

My question is what (and how does it) allows two different websites on the same IP be accessed by two different domains, for example what (and where) is the mechanism that decides a.com shows this and b.com shows this when the DNS entires for a.com and b.com are both 80.80.60.100?

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera270

3 Comments

Sorted by latest first Latest Oldest Best

 

@Shelton105

Because HTTP request sent from browsers includes the host name. The server is able to identify it and serve the respective content.

In our world we have very limited IPV4 addresses but more websites. A web hosting company usually serves over hundreds of websites from the same server (same IP).

10% popularity Vote Up Vote Down


 

@Gonzalez347

Your server that is listening at that address can decide what to serve up.

if request.host==host1 then
//Serve site 1
else
...


This was just pseudocode, but it can probably be done with most server side code frameworks

10% popularity Vote Up Vote Down


 

@Speyer207

You can host as many sites as you want from one Server (one IP). All you need is to is to:


Point the A record of the websites (from the DNS settings of the NameServers of the respective websites) that you want to host to the IP of the Server
Create Virtual hosts on the Server.


If you're using an IIS server, you can check out support.microsoft.com/en-us/kb/816576
There are different tutorials based on which server you're using. Just search for virtual hosts and the server and you should be good to go!

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme