使用DNS时配置IIS主机名
我需要为内部工具使用主机名,因此我提出了DNS Guy的请求,以在DNS服务器配置中添加“ oneplan.dev.ad.trw.com ”。
但是,当我访问“ OnePlan.dev.ad.trw.com”时,我将获得IIS欢迎页面:
如果我指定端口:OnePlan.dev.ad.trw.com: 6202 。该页面已正确显示。
我需要做什么才能使它在没有URL中的端口的情况下起作用?我无法使用默认端口80,因为我在同一服务器上有多个应用程序。
I need to use a host name for my internal tools so I made a request the DNS guy to add the "oneplan.dev.ad.trw.com" in the DNS server configuration.
After received that he did this:
But when I access the "oneplan.dev.ad.trw.com" I get the IIS welcome page:
And if I specify the port: oneplan.dev.ad.trw.com:6202. The page is displayed correctly.
What I need to to in order to make it work without the port in the URL? I can't use the default port 80 because I have multiple application on the same server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您有两个选项:
选项1-明确主机名
确保没有一个网站在端口80上具有通配符绑定 - 确保它们都指定了唯一的主机名。如果它们看起来如下,则必须添加配置bindings下的显式主机名(例如dev.ad.trw.com或 *.dev.ad.trw.com):
完成后,您应该能够将新站点的端口从6262更改为80,而IIS将根据主机名将端口80流量路由到适当的站点。
选项2-将IP地址添加到网卡中,
以便在同一台计算机上的端口80上的2个站点,而没有选项1中建议的显式主机名,您需要在网络接口中添加一个新的IP地址。我不确定您正在运行哪种版本的Windows以及您的服务器是否已安装Windows GUI。如果确实如此,只需进入卡的网络设置,然后按照下面的说明进行操作即可。这是一个相当直接的。
10.27.233.121 OnePlan.dev.ad.trw.com
如果网站加载,则全部设置。删除我们在最后一步中添加到主机文件中的行,并告诉您服务器盖伊修改OnePlan.dev.ad.trw.com的DNS记录,以指向10.27.233.121。
You have two options:
Option 1 - Explicit Host Names
Make sure none of the sites have a wildcard binding on port 80 - ensure they all have a unique Host Name specified. If they look like the following, you must added configure an explicit Host Name (e.g. dev.ad.trw.com or *.dev.ad.trw.com) under bindings:
Once this has been completed, you should be able to change the port of your new site from 6262 to 80 and IIS will route port 80 traffic to the appropriate site based upon Host Name.
Option 2 - Add IP Address to Network Card
In order to host 2 sites on port 80 on the same machine without explicit Host Names as suggested in Option 1, you need a new IP address added to the network interface. I'm not sure what version of windows you're running and whether your server has the windows GUI installed. If it does, just go into the network settings for the card and follow the instructions below. It's a fairly straight forward.
10.27.233.121 oneplan.dev.ad.trw.com
If the site loads, you're all set. Delete the line we added to the Host file in the last step, and tell you server guy to modify the DNS record for oneplan.dev.ad.trw.com to point to 10.27.233.121.
打开C:\ Windows \ System32 \ drivers \ etc \ etc \ hosts in Notepad作为管理员,进行输入:
10.27.233.121 OnePlan.dev.ad.ad.trw.com
进入命令窗口(WindowsKey+r tor WindowsKey+r tor Ophan Run Box并输入CMD )和键入ipconfig /flushdns
恭喜,您刚刚覆盖了该域地址的DNS,并且您的计算机专门将始终指向您在主机文件中定义的新IP。请记住,一旦您的域完成了一旦繁殖(您的DNS Guy都应该在处理服务器的DNS中记录记录),请清除它。
open c:\windows\system32\drivers\etc\hosts in notepad as administrator, make an entry:
10.27.233.121 oneplan.dev.ad.trw.com
go into a command window (windowskey+R to open run box and enter cmd) and type ipconfig /flushdns
Congrats, you've just overridden the DNS for that domain address and your computer specifically will always point to the new IP that you defined in the hosts file. Remember to clear it out once your domain is done propagating (your dns guy should have put an A record in the DNS handling the server)