IIS Home @ it-notebook.org

Host Headers versus multiple IPs when hosting several websites

(Kristofer Gafvert, June 30, 2005)

IIS can be used to host multiple websites (if a server edition of Windows is used, if a client edition is used, see link at the bottom) on a single server. To do this, one of these three things must be unique: IP, Port or Host Header name. Using a non-standard port is usually not an option, because that requires the client to specify the port when connecting to the webserver. This leaves us with two options to host multiple websites, either use a unique IP or Host Header name. But which of them is best?

If the website requires SSL, there is a need for a unique IP. The reason for this is simple, the Host Header is encrypted and cannot be decrypted until IIS has choosen which website it should route the request to (this is a limitation of HTTP and not IIS). So in this situation, unique IPs must be used.

With Windows Server 2003 SP1, SSL can be used with Host Headers. But it requires a wildcard certificate, and you cannot have a certificate such as *.com, so in general, it only works for subdomains of a "main" domain (for example *.gafvert.info). In a shared hosting environment, where each customer have their own domain, this is not an option.

Host Headers on the other hand is only available in HTTP 1.1 and later (this is not really a limitation, because almost every browser today is using HTTP 1.1 or later).

So, there is one situation where we are forced to use unique IPs. In all other situations, we can choose.

In general IP Addresses costs money. That is a disadvantage of using multiple IP addresses. Another disadvantage is that there is a performance overhead cost to use multiple IP addresses. The WWW Service must manage an endpoint for each unique IP address assigned to a website, and this consumes memory from the non-page pool. This will not be of any problem with a small number of websites (and IP addresses), but on a webserver used for shared hosting, with thousands of websites, each with a unique IP, it can become a problem. And it will definitely be a waste of valuable resources! The "Web and Application Server Infrastructure - Performance and Scalability"[1] white paper gives a practical limit of about 2000 IP addresses.

So the conclusion is: Whenever you are not forced to use unique IP addresses, use host headers!

Resources

[1] Web and Application Server Infrastructure - Performance and Scalability
Multiple websites on Windows XP Professional
Configuring SSL Host Headers (IIS 6.0)
KB187504, HTTP 1.1 host headers are not supported when you use SSL
KB324287, HOW TO: Use Host Header Names to Configure Multiple Web Sites in Internet Information Services 6.0