![IIS6 子域名无法解析](https://linux22.com/image/564034/IIS6%20%E5%AD%90%E5%9F%9F%E5%90%8D%E6%97%A0%E6%B3%95%E8%A7%A3%E6%9E%90.png)
我有一个子域名,例如 dev.something.root.com,我在这里遇到了连接超时。如果我 ping dev.something.root.com ,它会返回服务器的 IP 地址。如果我在 hosts 文件中输入 IP 地址,那么我就可以访问该网站。如果我把它取出来 - 我就不能再访问该网站了。
因此,该网站似乎没有问题,并且域名似乎正在解析正确的 IP。
我认为请求没有完全到达 IIS,因为它没有记录任何内容。
我该怎么做才能找出问题所在?
编辑
为什么当我将 IP 添加到 hosts 文件时它会起作用?
答案1
既然 DNS 解析到正确的 IP 地址,DNS 就没问题了。现在你只需要使用IIS 中的主机标头。
更多信息请见这里。
To add a Web site using a host header identifier using the Web Site Creation Wizard
1. In IIS Manager, expand the local computer, right-click the Web Sites directory, point to New, and then click Web Site.
2. Click Next.
3. In the Description box, type the name you have selected for the Web site, and then click Next.
4. In the Enter the IP address to use for this Web site box, click the IP address used by all sites on the server.
5. In the TCP port this Web site should use box, type the port number used by all sites on the server.
6. In the Host Header for this Web site (Default:None) box, type the host header name to identify the Web site. The host header name must contain the full name of the site, for example, dev.something.root.com.
7. If SSL encryption is not enabled on the server, the SSL port box does not appear. If SSL encryption is enabled on the server, type the SSL port number, and then click Next. Note that you cannot use host headers with SSL encryption.
8. In the Path box, type or browse to the path of your Web site home directory.
9. To create a secured or private Web site, clear the Allow anonymous access to this Web site check box, and click Next. (Web sites are configured for anonymous access by default.)
10. In the Web Site Access Permissions box, set the permissions for the home directory.
11. Click Next, and then click Finish.