简体   繁体   English

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

[英]Debian DNS Jessie - Subdomain to secondary server

Ok, so here i have one box好的,所以我有一个盒子

Windows Host (Debian Linux 8 VM - Oracle) -Set up. Windows 主机(Debian Linux 8 VM - Oracle)-设置。 A Live Working Machine, DNS apache php...etc..实时工作机器,DNS apache php...等。

IP is **AAAA** IP是**AAAA**

second machine, fresh install, second vm, php apache all running.第二台机器,全新安装,第二台虚拟机,php apache 都在运行。 DNS is not. DNS 不是。

IP is **AAAB** IP是**AAAB**

The External IPV40.外部 IPV40。 ISP Router. ISP 路由器。

IP is **XXXX** IP是**XXXX**

So the Goal is simple:所以目标很简单:

On thisdomain.com it has a local IP of **AAAA** but on the Second Server it has the IP **AAAB**thisdomain.com它的本地IP of **AAAA**但在第二台服务器上,它的 IP 为**AAAB**

IP AAAA Serves the domain and the website for www.thisdomain.com and thisdomain.com.` IP AAAA为 www.thisdomain.com 和 thisdomain.com 提供域名和网站。`

I wish to have ls.thisdomain.com serve IP **AAAB**我希望ls.thisdomain.com服务 IP **AAAB**

The DNS Records `are like so: 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.
    ;

on the main server that serves domain IP 2 = **AAAA** :在为域IP 2 = **AAAA**提供服务的主服务器上:


    $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.
    ;

and whats this issue?这是什么问题? well, it seems that even though i think there good to go, the ls.好吧,似乎即使我认为有好处,ls。

Subdomain still only shows the first servers Apache website **AAAA**子域仍然只显示第一台服务器Apache website **AAAA**
instead of the second servers **AAAB** Apache Website.而不是第二个服务器**AAAB** Apache Website.

What i want is it to be like this ls.thisdomain.com我想要的是像这样的ls.thisdomain.com
hits public ip XXXX then searches NS1 on IP AAAA then send user to webpage on server LS which is AAAB .点击public ip XXXX然后在IP AAAA上搜索NS1然后将用户发送到服务器LS上的网页,即AAAB

How would one Achieve this to be so that it does happen?如何实现这一点,以便它确实发生?

Well, there are several apparent errors above.好吧,上面有几个明显的错误。 First, the whole idea of having two different zones for the same name is meaningless because it requires an unnecessary level of DNS recursion - you should serve a single consolidated DNS zone, and if you need two servers for redundancy, then make one of them master and the other one slave (a verbatim copy of the master).首先,为同名拥有两个不同区域的整个想法毫无意义,因为它需要不必要的 DNS 递归级别 - 您应该提供一个统一的 DNS 区域,如果您需要两台服务器以实现冗余,那么让其中一个成为主服务器和另一个奴隶(主人的逐字副本)。

Second, the second zone lists adds two additional NS records compared to the first zone, but all of those in turn point to the same IP address.其次,与第一个区域相比,第二个区域列表添加了两个额外的 NS 记录,但所有这些记录又指向相同的 IP 地址。 This is also meaningless.这也是毫无意义的。

Third, the name ls.thisdomain.com is defined as a round-robin DNS entry, meaning 50% of the clients will resolve it to XXXX, while another 50% will resolve it to AAAB Each of those clients will then cache that result for 38400 seconds and then repeat the query, after which point they again have a 50:50 chance of getting either result.第三,名称 ls.thisdomain.com 被定义为循环 DNS 条目,这意味着 50% 的客户端将其解析为 XXXX,而另外 50% 的客户端将其解析为 AAAB 每个客户端将缓存结果38400 秒,然后重复查询,此后他们再次有 50:50 的机会获得任一结果。

It's unclear from the question whether AAA* is perhaps a private IP network.从问题中不清楚 AAA* 是否可能是一个私有 IP 网络。 If the intent is to allow external users to access AAAB which is in a private network, then DNS is simply not the solution.如果目的是允许外部用户访问私有网络中的 AAAB,那么 DNS 根本不是解决方案。 DNS is a Layer 7 protocol which doesn't care which kind of IPs its results will contain, but the external users can't route via Layer 3 to external private networks. DNS 是第 7 层协议,它不关心其结果将包含哪种 IP,但外部用户无法通过第 3 层路由到外部专用网络。 HTTP traffic can only arrive at the public XXXX IP, typically at port 80, and then the router can pass it on (NAT it) to an HTTP server. HTTP 流量只能到达公共 XXXX IP,通常在端口 80,然后路由器可以将其传递 (NAT) 到 HTTP 服务器。 This HTTP server in turn can pass the results on to two separate virtual hosts or even two separate machines (proxying).这个 HTTP 服务器又可以将结果传递给两个独立的虚拟主机,甚至两个独立的机器(代理)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM