来自 windows 的绑定(在 aws 中)子域委托未解析
bind(in aws) sub domain delegation from windows not resolving
我在 Windows AD DNS 中有一个内部域,比如 example.com。我已经创建了一个子域委托 aws.example.com,其中有一个粘合记录指向 AWS 中的一个 BIND 9.8 实例(通过站点到站点 VPN)。
BIND 实例有一个区域配置为仅转发(带转发器),指向具有 AWS Rt 的 AWS VPC 子网解析器。 53 区域 (aws.example.com) 关联。
问题是解析无法正常工作,有时...如果我针对 Rt 中主机的 Windows DNS 进行挖掘或 nslookup,则来自我的内部网络。 53 区域,我没有得到答案(尽管我确实看到查询命中 BIND)。如果我然后 dig/nslookup 直接针对 BIND 实例,它就可以工作。
现在,如果我回到第一步,dig/nslookup 针对 Windows DNS,我确实得到了成功的解析。
就好像通过 Windows DNS 来的初始 dig/nslookup 没有触发仅转发行为,直接查询是 & 然后缓存答案。
谁能深入了解我做错了什么或如何改变这种行为?
绑定配置:
acl goodclients {
172.31.0.0/16;
192.168.0.0/16;
localhost;
localnets;
};
options {
directory "/var/cache/bind";
recursion yes;
allow-query { goodclients; };
forwarders {
172.31.0.2;
};
#forward only;
dnssec-enable yes;
dnssec-validation yes;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
querylog yes;
};
zone "aws.example.com" {
type forward;
forward only;
forwarders { 172.31.0.2; };
};
这是失败-成功-成功序列的示例 运行 查询到 windows 然后再从 2 个不同的客户端绑定 windows:
windows AD dns domain example.com
\_ subdomain aws.example.com —> NS 172.31.32.5 (bind instance in AWS )
\_ —> forwarding to:172.31.0.2 (aws VPC resolver IP) to Rt.53 associated zone
client 1:
user1@vfvps-server:~ #date
Wed Sep 14 14:18:41 EDT 2016
user1@vfvps-server:~ #nslookup
> lserver 192.168.4.147 <—————windows dns
Default server: 192.168.4.147
Address: 192.168.4.147#53
> server1.aws.example.com
Server: 192.168.4.147
Address: 192.168.4.147#53
** server can't find server1.aws.example.com: NXDOMAIN
> exit
client 2:
KWK-MAC:~ user1$ date
Wed Sep 14 14:19:29 EDT 2016
KWK-MAC:~ user1$ dig @172.31.32.5 server1.aws.example.com <—— 172.31.32.5 = bind
; <<>> DiG 9.8.3-P1 <<>> @172.31.32.5 server1.aws.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23154
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0
;; QUESTION SECTION:
;server1.aws.example.com. IN A
;; ANSWER SECTION:
server1.aws.example.com. 300 IN A 172.31.14.41
client 1:
user1@vfvps-server:~ #date
Wed Sep 14 14:19:40 EDT 2016
user1@vfvps-server:~ #nslookup
> lserver 192.168.4.147
Default server: 192.168.4.147
Address: 192.168.4.147#53
> server1.aws.example.com
Server: 192.168.4.147
Address: 192.168.4.147#53
Non-authoritative answer:
Name: server1.aws.example.com
Address: 172.31.14.41
Windows 配置了子域委托的 DNS 服务器将向您的 BIND 服务器发送迭代查询。 BIND 只有在权威或来自缓存时才会响应。
(你可以尝试dig +norecurse server1.aws.example.com @172.31.32.5
,它会失败)
在您的 Windows DNS 中,您需要为 aws.example.com 配置 "Conditional Forwarder"。
我在 Windows AD DNS 中有一个内部域,比如 example.com。我已经创建了一个子域委托 aws.example.com,其中有一个粘合记录指向 AWS 中的一个 BIND 9.8 实例(通过站点到站点 VPN)。 BIND 实例有一个区域配置为仅转发(带转发器),指向具有 AWS Rt 的 AWS VPC 子网解析器。 53 区域 (aws.example.com) 关联。 问题是解析无法正常工作,有时...如果我针对 Rt 中主机的 Windows DNS 进行挖掘或 nslookup,则来自我的内部网络。 53 区域,我没有得到答案(尽管我确实看到查询命中 BIND)。如果我然后 dig/nslookup 直接针对 BIND 实例,它就可以工作。 现在,如果我回到第一步,dig/nslookup 针对 Windows DNS,我确实得到了成功的解析。 就好像通过 Windows DNS 来的初始 dig/nslookup 没有触发仅转发行为,直接查询是 & 然后缓存答案。 谁能深入了解我做错了什么或如何改变这种行为?
绑定配置:
acl goodclients {
172.31.0.0/16;
192.168.0.0/16;
localhost;
localnets;
};
options {
directory "/var/cache/bind";
recursion yes;
allow-query { goodclients; };
forwarders {
172.31.0.2;
};
#forward only;
dnssec-enable yes;
dnssec-validation yes;
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
querylog yes;
};
zone "aws.example.com" {
type forward;
forward only;
forwarders { 172.31.0.2; };
};
这是失败-成功-成功序列的示例 运行 查询到 windows 然后再从 2 个不同的客户端绑定 windows:
windows AD dns domain example.com
\_ subdomain aws.example.com —> NS 172.31.32.5 (bind instance in AWS )
\_ —> forwarding to:172.31.0.2 (aws VPC resolver IP) to Rt.53 associated zone
client 1:
user1@vfvps-server:~ #date
Wed Sep 14 14:18:41 EDT 2016
user1@vfvps-server:~ #nslookup
> lserver 192.168.4.147 <—————windows dns
Default server: 192.168.4.147
Address: 192.168.4.147#53
> server1.aws.example.com
Server: 192.168.4.147
Address: 192.168.4.147#53
** server can't find server1.aws.example.com: NXDOMAIN
> exit
client 2:
KWK-MAC:~ user1$ date
Wed Sep 14 14:19:29 EDT 2016
KWK-MAC:~ user1$ dig @172.31.32.5 server1.aws.example.com <—— 172.31.32.5 = bind
; <<>> DiG 9.8.3-P1 <<>> @172.31.32.5 server1.aws.example.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23154
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 13, ADDITIONAL: 0
;; QUESTION SECTION:
;server1.aws.example.com. IN A
;; ANSWER SECTION:
server1.aws.example.com. 300 IN A 172.31.14.41
client 1:
user1@vfvps-server:~ #date
Wed Sep 14 14:19:40 EDT 2016
user1@vfvps-server:~ #nslookup
> lserver 192.168.4.147
Default server: 192.168.4.147
Address: 192.168.4.147#53
> server1.aws.example.com
Server: 192.168.4.147
Address: 192.168.4.147#53
Non-authoritative answer:
Name: server1.aws.example.com
Address: 172.31.14.41
Windows 配置了子域委托的 DNS 服务器将向您的 BIND 服务器发送迭代查询。 BIND 只有在权威或来自缓存时才会响应。
(你可以尝试dig +norecurse server1.aws.example.com @172.31.32.5
,它会失败)
在您的 Windows DNS 中,您需要为 aws.example.com 配置 "Conditional Forwarder"。