Click to Rate and Give Feedback
TechNet
TechNet Library
Windows Server
Web Server (IIS)
Managing Sites
 Configure a Host Header for a Web S...
Configure a Host Header for a Web Site (IIS 7)

Applies To: Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Vista

Host headers (also known as domain names or host names) let you assign more than one site to a single IP address on a Web server.

noteNote
  Host headers work for HTTP 1.1-compliant browsers (Internet Explorer 3.x and later, or Netscape Navigator 3.x and later).

To host more than one Web site on a Web server, you can assign a unique IP address to each Web site, designate a non-standard TCP port number for a Web site, or use host headers. Of the three methods, it is more common to use host headers than to assign unique IP addresses to Web sites or to use non-standard TCP port numbers.

noteNote
After you configure a host header or multiple host headers for an IP address, you must register the host headers with the appropriate name resolution system. If your computer is on an intranet, register the host header name or names with the intranet's name resolution system. If your computer is on the Internet, register the host header name or names with the Domain Name System (DNS), which is administered by InterNic.

Prerequisites

For information about the levels at which you can perform this procedure, and the modules, handlers, and permissions that are required to perform this procedure, see Sites Feature Requirements (IIS 7).

Exceptions to feature requirements

  • None

To configure a host header for a site

You can perform this procedure by using the user interface (UI), by running Appcmd.exe commands in a command-line window, by editing configuration files directly, or by writing WMI scripts.

User Interface

To use the UI
  1. Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7).

  2. In the Connections pane, expand the Sites node in the tree, and then select the site for which you want to configure a host header.

  3. In the Actions pane, click Bindings.

  4. In the Site Bindings dialog box, select the binding for which you want to add a host header and then click Edit or click Add to add a new binding with a host header.

  5. In the Host name box, type a host header for the site, such as www.contoso.com.

  6. Click OK.

  7. To add an additional host header, create a new binding with the same IP address and port, and the new host header. Repeat for each host header that you want to use this IP address and port.

Command Line

To add a host header to a Web site's binding, use the following syntax:

appcmd set site /site.name: string /bindings.[protocol=' string ',bindingInformation=' string '].bindingInformation: string

The variable site.name string is name of the site to which you want to add a host header. The variable [protocol='string',bindingInformation='string'] is the existing binding to which you want to add a host header, and bindingInformation string is the new binding with host header.

For example, to configure a site named contoso with an existing HTTPS binding for all IP addresses, on port 443, without a host header to have a host header named marketing, type the following at the command prompt, and then press ENTER:

appcmd set site /site.name: contoso /bindings.[protocol='https',bindingInformation='*:443:'].bindingInformation:*:443: marketing

For more information about Appcmd.exe, see Appcmd.exe (IIS 7).

Configuration

The procedure in this topic affects the following configuration elements:

<bindings> under <site> element

For more information about IIS 7 configuration, see IIS 7.0: IIS Settings Schema on MSDN.

WMI

Use the following WMI classes, methods, or properties to perform this procedure:

  • Site.Bindings property

  • BindingElement.BindingInformation property

For more information about WMI and IIS, see Windows Management Instrumentation (WMI) in IIS 7. For more information about the classes, methods, or properties associated with this procedure, see the IIS WMI Provider Reference on the MSDN site.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
host header IS settable for port 443 (https)      CamyDee ... JeffJCom   |   Edit   |   Show History

Worked for me.
I have a wild card certificate from Godaddy.

http://technet.microsoft.com/en-us/library/cc731692(WS.10).aspx

and
http://technet.microsoft.com/en-us/library/cc753195(WS.10).aspx

for

appcmd set site "Site" /+bindings.[protocol='https',bindingInformation='*:443:']

went and set certificate to my wild card

then

appcmd set site "Site" /bindings.[protocol='https',bindingInformation='*:443:'].bindingInformation:*:443:www.domain.com

then

appcmd set site "Site" /+bindings.[protocol='https',bindingInformation='*:443:']

went and set certificate to my wild card

then

appcmd set site "Site" /bindings.[protocol='https',bindingInformation='*:443:'].bindingInformation:*:443:www

Now have 2 host header on 443.

The second should give certificate error as wildcard is *.domain.com, but wanted it for dev to just get to www.

Tags What's this?: header (x) host (x) ssl (x) Add a tag
Flag as ContentBug
IIS Manager does (with a caveat) allow host header for HTTPS sites....      cbuzzsaw   |   Edit   |   Show History
The UI for the IIS Manager seems to key off of the "Friendly Name" of the certificate.

For example if you have a wild card certificate that is installed for the server (i.e. *.mydomain.com) and you give it a friendly name of "wwwmydomain" then the UI protects the host header field when editing the bindings. To have the IIS Manager unprotect the HostHeader field, give the certificate a friendly name begining with an asterik "*" (i.e. *.mydomain.com).

With this friendly naming convention, the IIS Manager UI unprotects the host header field and allows you to specify your host header as desired once the certificate is selected.

If you already imported the certificate, you can use the Certificate Services MMC snap-in to change the friendly name of the certificate.

I'm uncertain as to why the IIS team doesn't specify this anywhere or if they know it can be done as I haven't found any documentation on this "feature", I just happened to stumble upon it while working in my development environment.

Hope that helps some of you out there in your day to day managment of IIS, however if you are doing any major management of IIS servers you should look at the Microsoft Managment APIs to automate much of your administration.

Cheers
Tags What's this?: gray (x) grey (x) host (x) hostheader (x) name (x) ui (x) Add a tag
Flag as ContentBug
Re: host header is not settable for port 443 (https)      Brandon.M   |   Edit   |   Show History
From what I understand, host headers were never supported on any SSL binding because that part of the packet (header) is encrypted. You must use a unique IP address for any 443 SSL binding.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker