无法映射本地主机网络服务器中的子域
我正在使用 Asp.net mvc 框架开发一个 Web 应用程序,并具有社区子域的概念。
我实现了 *.example.com 等域的通配符映射概念。为了测试 vs 2008 中的概念,我编辑了主机文件并添加了一些子域,例如
127.0.0.1 a.localhost
127.0.0.1 b.localhost
当我请求 url
"nofollow noreferrer">http://a.localhost:1760/ 我在尝试检索 URL 时 : http://a.localhost:1760/
遇到以下错误:
Unable to determine IP address from host name for a.localhost
dnsserver 返回:
Name Error: The domain name does not exist.
这意味着:
缓存无法解析 URL 中显示的主机名。 检查地址是否正确。
我应该做什么来解决这个错误。
I am developing a web application using Asp.net mvc framework with concept of sub domain for community.
I have implement concept of wild card mapping of domain like *.example.com. To test concept in vs 2008 i edited hosts file and add some sub domain like
127.0.0.1 a.localhost
127.0.0.1 b.localhost
When i request url http://a.localhost:1760/ i get error
While trying to retrieve the URL: http://a.localhost:1760/
The following error was encountered:
Unable to determine IP address from host name for a.localhost
The dnsserver returned:
Name Error: The domain name does not exist.
This means that:
The cache was not able to resolve the hostname presented in the URL.
Check if the address is correct.
What i should do to resolve this error.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
localhost 不能有子域 - 这是一个保留的 DNS 名称,根本不支持子域。您可以改为使用 a.myhost.example 和 b.myhost.example,但请注意 Cassini(VS 开发 Web 服务器)不理解主机标头。
localhost can't have subdomains - it's a reserved DNS name that simply doesn't support them. You could, instead, use a.myhost.example and b.myhost.example, but be aware that Cassini, the VS development web server doesn't understand host headers.