O'Reilly logo

Professional Microsoft IIS 8 by Benjamin Perkins, Dennis Glendenning, Scott Forsyth, Jeff Cochran, Kenneth Schaefer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring Host Headers

Host headers enable you to publish multiple domain names or websites to a single IP address. This allows a web administrator to run several sites on a single IP. It also allows a single website to have multiple names resolve for it, such as website1.com and www.website1.com.

Host headers are an optional configuration item on site bindings. Bindings are used to configure Http.sys to listen on ports and IP addresses. The properties of a binding are the following:

  • Type—HTTP/HTTPS—HTTPS to enable Secure Sockets Layer (SSL)
  • IP address
  • Port
  • Host header

Each website running on the server must have a unique binding—a unique combination of IP address + TCP port + host header value. By ensuring that each website has a unique binding, incoming requests can be routed to the uniquely identified website, based on the properties of the request.

When a client sends a HTTP request to IIS, it sends an HTTP Host header, indicating the website that it wishes to access. This HTTP Host header, along with the TCP port (by default, port 80 or port 443), plus IP address, is first decoded by the server, allowing the requested location to be extracted from the request and checked against the IIS server's metabase for matching binding entries. In the following example HTTP request, a GET request for the file default.htm was made to a site called www.Website1.com (two CRLFs [carriage return plus line feed] signify the end of the HTTP request):

GET /default.htm HTTP/1.1 Host: www.Website1.com ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required