DNS 如何设置指向同一子域的多个 A 记录?

发布于 2024-11-30 22:59:21 字数 675 浏览 0 评论 0 原文

我有一个可以正常工作的子域 sub1.primary.com。现在我需要设置 sub2.primary.com 并让它指向与 sub1.primary.com 相同的 Web 应用程序。我尝试将其作为新的 A 记录和新的 CName,但是当我尝试导航到 sub2.primary.com 并期望看到 sub1.primary.com 时,我看到 sub7.primary.com 上有一个完全不同的应用程序。

我尝试过 A 记录独奏、CName 独奏、两者一起尝试,以及带有和不带有指针记录的每个实例。我正在使用带有 IIS 6 的 Windows 2003 Server。我尝试在谷歌上搜索答案,但找不到任何信息。

这是我目前的设置。我已在 DNS 中为 sub2.primary.com 创建了一条主机 (A) 记录以及关联的指针记录。我已将 sub2.primary.com 添加到 sub1.primary.com 的主机标头。每当我导航到 sub2.primary.com 时,它都会显示 sub7.primary.com 而不是 sub1.primary.com。这很奇怪,因为如果它要默认为某些内容,我宁愿它默认为 www.primary。 com。

我不知道这是否重要,但 sub1.primary.com 使用 SSL,sub7.primary.com 以及其他 5 个 *.primary.com SSL 证书也是如此。

I have a sub-domain sub1.primary.com that works correctly. Now I need to setup sub2.primary.com and have it point to the same web application as sub1.primary.com. I tried it as a new A record and a new CName however when I try navigating to sub2.primary.com and expect to see sub1.primary.com I see a completely different application that sits on sub7.primary.com.

I have tried the A record solo, the CName solo, both together, and each instance with and without pointer records. I am using a Windows 2003 Server with IIS 6. I tried googling for an answer and couldn't find any information.

Here is my setup at the moment. I have created a Host (A) record in DNS for sub2.primary.com with an associated pointer record. I have added the sub2.primary.com to host headers of sub1.primary.com. Whenever I navigate to sub2.primary.com it displays sub7.primary.com instead of sub1.primary.com. Which is bizarre because if it were going to default to something I would rather it default to www.primary. com.

I don't know if it matters but the sub1.primary.com is under SSL and so is sub7.primary.com, along with 5 others on a *.primary.com SSL cert.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

离笑几人歌 2024-12-07 22:59:21

每个子域都应该有一条指向同一 IP 的 A 记录。我听起来这就是您首先尝试的方法 - 如果这不起作用,我建议确保您的 Web 服务器的虚拟主机配置将 sub2.primary.com 发送到正确的位置。

Each subdomain should have an A record pointing to the same IP. I sounds like this is what you tried first -- if that didn't work, I'd suggest making sure that your web server's vhost configuration is sending sub2.primary.com to the right place.

望笑 2024-12-07 22:59:21

当 IIS 在同一 IP 地址上托管多个网站时,它会使用传入请求 URL 来猜测将客户端发送到哪个虚拟站点。

换句话说:您需要配置主机标头以接受相应网站的两个名称。 Microsoft 在此处此处 , 或 这里有更详细的解释

When IIS hosts multiple websites on the same IP address, it uses the incoming request URLs to guess which virtual site to send the client to.

In other words: you need to configure your host headers to accept both names for the appropriate web site. Microsoft publishes some good how-to documentation here and here, or here is a more detailed explanation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文