Configure a Host Header for a Web Site (IIS 7)

本文介绍了Web服务器中主机头(域名或主机名)的作用,可让一个IP地址对应多个站点,适用于HTTP 1.1兼容浏览器。还提及配置主机头的三种方法,其中使用主机头更为常见,且配置后需在相应名称解析系统注册。同时给出了通过用户界面配置主机头的具体步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

Note 
  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.

Note 
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
Open IIS Manager. For information about opening IIS Manager, see Open IIS Manager (IIS 7) .

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.

In the Actions pane, click Bindings .

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.

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

Click OK .

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.

转载于:https://www.cnblogs.com/henryhappier/archive/2010/01/25/1656167.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值