IIS TIPS - Host Header

Host Header ? what is it ? This is a very common question in IIS discussion groups. Host header is the Name (either NetBIOS or FQDN) that associated to a website in IIS, it is used to host multiple websites using 1 IP address running on default port 80. Websites in IIS can be distinguished using three unique identifiers. These unique identifiers include:
Host Header Name
IP Address
Port Number

You can have multiple websites running on IIS as long as either of the above three identifiers is unique. For example:
Host Header -
www.a.com
IP Address - 192.168.10.10
Port Number - 80

Host Header - www.b.com
IP Address - 192.168.10.10
Port Number - 80


Host Header -
IP Address - 192.168.10.11
Port Number - 80


and many more...  detail steps ? refer MS KBs...
IIS 6.0 - 324287 HOW TO: Use Host Header Names to Configure Multiple Web Sites in Internet Information Services 6.0
IIS 5.0 - 308163 How To Use Host Header Names to Configure Multiple Web Sites in Internet Information Services 5.0
            190008 HOW TO: Use Host Header Names to Host Multiple Sites from One IP Address in IIS 5.0
IIS 4.0 - The steps are similar to IIS 5.0, or you can refer this article at IISFAQ.com.

Now, you are 50% done with the above. To complete the configuration, you need to work with Name resolution, in short is how do get those host name works. You need to ensure when users query those host name it will returns the correct IP address that you setup. So you can either have DNS resolution or via a host file. And you can either have your own DNS or using your existing one, bottom line is to get the name resolution works and users get the correct IP address. Read
IIS 6.0 - 324260 How To Configure DNS Records for Your Web Site in Windows Server 2003
IIS 5.0 - 315982 HOW TO: Configure DNS Records for Your Web Site in Windows 2000
IIS 4.0 - 172953 How to Install and Configure Microsoft DNS Server.

If you don't have any DNS server, you can use the following article which utilizing HOSTS file to facilitate Intranet name resolution.
228760 - How to Use a HOSTS File to Test a Site that Uses Host Headers on an Intranet

Next, after you configured host header, you can not browse to that specific site with its IP address, this is because IIS don't know which site to display. You will get a 'No website is configured for this address' in your browser, refer
300238 - Error Message: "No Web Site Is Configured At This Address" When Using Host Headers

From time to time, I get questions like “How do configure Host Header with FTP ?“ Well, the answer is NO. FTP doesn't support host header concept. You are advised to use virtual directory + proper NTFS configuration to achieve the same purposes. However, the name resolution will only have ONE name. To create multiple ftp site, the only unique identifiers are IP and Port. Now, we know Host Header doesn't click with FTP, SSL is another implementation that doesn't click with host header, refer
187504 - HTTP 1.1 Host Headers Are Not Supported When You Use SSL

Comments

# Host Header Tips

Thursday, July 29, 2004 6:56 AM by TrackBack

# re: IIS TIPS - Host Header

Saturday, September 11, 2004 1:34 AM by bernard

Thanks for the help, the CName info is what i've been missing. I don't have a CName for my default website and it works fine. Why do i need one for each additional website i host with IIS 6.0/Win2003

# re: IIS TIPS - Host Header

Saturday, September 11, 2004 9:32 PM by bernard

CNAME is just an type of DNS record, if you using A (host) record, it will works too. As long as the name resolution is pointing to the configured IP address specified in the website settings, it should be fine.

# re: IIS TIPS - Host Header

Thursday, December 30, 2004 9:51 AM by bernard

Is there a workaround here? I bought my own server thinking i would be able to host all parts of my website on it. But if I am understanding the host header/ssl problem correctly, my shopping cart has to be on this maching by itself, and i will have to get a another machine (or keep paying for hosting) for everything else. The problem is I wanted to make the main site dynamic, with web apps like forums and on the fly web page creation so it could be a lot snazzier and more competitive. any suggestions welcome. thanx.

natcolley@earthlink.net

# re: IIS TIPS - Host Header

Thursday, December 30, 2004 11:59 AM by bernard

Hi Nat,

SSL doesn't click with host header, hence for each SSL site you need separate IP address.

Cheers.

# re: IIS TIPS - Host Header

Friday, September 15, 2006 4:09 AM by Soren Werk

It is now possible to use host header names with SSL on IIS 6.0 on Windows Server 2003 SP1. http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/596b9108-b1a7-494d-885d-f8941b07554c.mspx?mfr=true

# re: IIS TIPS - Host Header

Saturday, September 16, 2006 12:35 AM by qbernard

Yes, Soren, you are correct. Back then in 2004 when I replied, this is not possible :)