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

Debian DNS Jessie - Subdomain to secondary server

好的,我这里有一个盒子

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 of **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 website **A.A.A.A**
而不是第二台服务器 **A.A.A.B** Apache Website.

我想要的就是这样 ls.thisdomain.com
命中 public ip X.X.X.X 然后搜索 NS1IP 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 层协议,它不关心其结果将包含哪种 IP,但外部用户无法通过第 3 层路由到外部专用网络。 HTTP 流量只能到达 public X.X.X.X IP,通常在端口 80,然后路由器可以将其传递(NAT)到 HTTP 服务器。该 HTTP 服务器又可以将结果传递给两个独立的虚拟主机甚至两个独立的机器(代理)。