gpt4 book ai didi

linux - Debian DNS Jessie - 辅助服务器的子域

转载 作者:太空宇宙 更新时间:2023-11-04 05:26:20 25 4
gpt4 key购买 nike

好的,我这里有一盒

Windows 主机(Debian Linux 8 VM - Oracle)-设置。一台实时工作的机器,DNS apache php...等等。

IP 是 **A.A.A.A**

第二台机器,全新安装,第二台虚拟机,php apache 全部运行。 DNS 不是。

IP 是 **A.A.A.B**

外部 IPV40。 ISP 路由器。

IP 是 **X.X.X.X**

所以目标很简单:

thisdomain.com 上,它的本地IP 为 **A.A.A.A**但在第二台服务器上它有 IP **A.A.A.B**

IP A.A.A.A 为 www.thisdomain.com 和 thisdomain.com 的域和网站提供服务。`

我希望让 ls.thisdomain.com 提供 IP **A.A.A.B**

DNS记录`就像这样:

<小时/>
    $TTL    38400
thisdomain.com. IN SOA ls.thisdomain.com. webmaster.thisdomain.com. (
5 ; Serial
1d ; Refresh
60m ; Retry
7d ; Expire
6h ) ; Negative Cache TTL
; ### this is the forward zone of IP 2 A.A.A.B (ls.thisdomain.com)
thisdomain.com. IN A X.X.X.X
thisdomain.com. IN NS ls.thisdomain.com.
ls.thisdomain.com. IN A X.X.X.X
ls.thisdomain.com. IN A A.A.A.B
;
www IN CNAME thisdomain.com.
;

在服务域的主服务器上IP 2 = **A.A.A.A**:

<小时/>
    $TTL    38400
thisdomain.com. IN SOA ns1.thisdomain.com. webmaster.thisdomain.com. (
5 ; Serial
1d ; Refresh
60m ; Retry
7d ; Expire
6h ) ; Negative Cache TTL
;
thisdomain.com. IN A X.X.X.X
ns1.thisdomain.com. IN A X.X.X.X
ns2.thisdomain.com. IN A X.X.X.X
ls.thisdomain.com. IN A X.X.X.X
thisdomain.com. IN NS ls.thisdomain.com.
ls.thisdomain.com. IN A A.A.A.B
thisdomain.com. IN NS ns1.thisdomain.com.
thisdomain.com. IN NS ns2.thisdomain.com.
;
www IN CNAME thisdomain.com.
;

这是什么问题?好吧,看来即使我认为那里很好去,ls。

子域仍然只显示第一台服务器Apache 网站 **A.A.A.A**
而不是第二个服务器**A.A.A.B** Apache 网站。

我想要的是这样的ls.thisdomain.com
点击数公共(public)IP X.X.X.X然后搜索NS1 开启IP A.A.A.A然后将用户发送到服务器上的网页LSA.A.A.B

如何实现这一目标以便它确实发生?

最佳答案

嗯,上面有几个明显的错误。首先,为同一个名称设置两个不同区域的整个想法是没有意义的,因为它需要不必要的 DNS 递归级别 - 您应该提供一个统一的 DNS 区域,如果您需要两台服务器作为冗余,则将其中一台设为主服务器,另一台设为从服务器(主服务器的逐字副本)。

其次,与第一个区域相比,第二个区域列表添加了两条额外的 NS 记录,但所有这些记录又都指向相同的 IP 地址。这也是没有意义的。

第三,名称 ls.thisdomain.com 被定义为循环 DNS 条目,这意味着 50% 的客户端会将其解析为 X.X.X.X,而另外 50% 的客户端会将其解析为 A.A.A.B。然后,每个客户端都会将该结果缓存 38400 秒,然后重复查询,之后它们再次有 50:50 的机会获得任一结果。

从问题中尚不清楚 A.A.A.* 是否可能是专用 IP 网络。如果目的是允许外部用户访问专用网络中的 A.A.A.B,那么 DNS 根本不是解决方案。 DNS 是第 7 层协议(protocol),不关心其结果将包含哪种 IP,但外部用户无法通过第 3 层路由到外部专用网络。 HTTP 流量只能到达公共(public) X.X.X.X IP,通常位于端口 80,然后路由器可以将其传递(NAT)到 HTTP 服务器。该 HTTP 服务器又可以将结果传递到两个单独的虚拟主机,甚至两台单独的机器(代理)。

关于linux - Debian DNS Jessie - 辅助服务器的子域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31106781/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com