The following post walks you through 3 scenarios for setting up Bindings using Internet Information Services (IIS). This information will allow you to host multiple sites on a single Dedicated Windows Server or Windows Cloud Server.
When IIS is first installed, a default website is already configured. You can right-click on this site and choose Site Bindings to see the site bindings for the default website. If you haven’t made any changes to your default website, it should look similar to the image below.
There are three values that can be used in a site binding: IP Address, Port and Host Name. In the default website you see that the only values specified are the Port and IP Address. The default site is bound to port 80 on any IP address that does not have another binding. This gives you a “fallback” website for all requests that come to your server on port 80 and do not match any other site bindings.
IMPORTANT: When setting up site bindings on your Dedicated or Cloud server, all site bindings must be unique. The combination of IP address, port and host name must be different from all other site bindings on your server.
Below are some common situations and how you might set up your site bindings.
Example 1: Web server with multiple IP addresses
In this situation we are going to assign a separate IP address for each website.
Company Assigned IP Address Port
Acme Products 192.168.1.200 80
Foobar Inc. 192.168.1.201 80
First we will set up the binding for the Acme Products website as shown below.
Any web request coming to 192.168.1.200 on port 80 will be served by this website. It does not matter what host header is used. It could be acmeproducts.com or www.acmeproducts .com or any other host that is configured in DNS to go to this IP address.
Similarly, we would assign the site bindings for Foobar Inc so that requests going to 192.168.1.201 on port 80 will go to their site.
Example 2: Web server with one IP address using host name bindings
This situation is common at lost cost web hosting companies or in a situation where you run a server from your house or small business and only have one IP address to allocate to your web server. Since we do not have enough IP addresses to assign to each site, we will use host headers to differentiate which website will serve requests. In this case, the only IP address on the server is 192.168.1.200.
Acme products would like their site to respond to requests for acmeproducts.com and www.acmeproducts.com. Since we have multiple sites on the server using the same IP address and port combination, we must use the host name to differentiate this site from the others. We will set up two site bindings. One for each host name that we want this site to respond to.
Foobar Inc would like their site to respond to foobarinc.com, www.foobarinc.com and blogs.foobarinc.com. We will add three bindings to this site.
As you can see, both sites are using the same IP address and port. The host name is the one thing that differentiates the two sites. If we tried to add a binding for foobarinc.com to the Acme site, we will get a warning telling us that the same binding already exists.
If we allowed IIS to add this binding, we would have an issue the next time IIS started. It would start the first website with this binding but the second site would not be started.
Example 3: Web server with one IP address using port number bindings
In this example we are going to use different port numbers to identity the site that should respond to a request. Both sites will use the IP address 192.168.1.200. Acme Products will be configured to use port 80 as shown below.
Foobar Inc will be configured to use port 8080.
There is one downside to configuring your sites this way. Web browsers use port 80 by default. In the case of our two websites, the Acme site will work fine but the Foobar website will not come up in a browser with a standard URL. In order to get to the Foobar website, you will have to enter the URL like this: http://www.foobarinc.com:8080. The colon and port number must be added at the end of the URL for non-standard ports.