DNS 响应不返回答案部分,只有权限部分。DNS 在基于镜像的 docker 上运行sameersbn/bind
。以下是绑定文件:
/etc/bind/named.conf/
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
/etc/bind/named.conf.local
zone "ben.com" {
type master;
file "/var/lib/bind/ben.com.hosts";
};
/var/lib/bind/ben.com.hosts
$TTL 86400
@ IN SOA masterdns.ben.com. root.ben.com. (
100 ;Serial
3600 ;Refresh
1800 ;Retry
604800 ;Expire
86400 ;Minimum TTL
)
@ IN NS masterdns.ben.com.
@ IN A 11.0.0.10
@ IN A 11.0.0.11
@ IN A 11.0.0.12
@ IN A 11.0.0.13
masterdns IN A 11.0.0.10
webserver1 IN A 11.0.0.11
webserver2 IN A 11.0.0.12
nginx IN A 11.0.0.13
Response from dns
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.5 <<>> masterdns.ben.com @172.18.0.2
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 28334
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;masterdns.ben.com. IN A
;; AUTHORITY SECTION:
ben.com. 38400 IN SOA 10.0.0.20. benshalev849.gmail.com. 1624192868 10800 3600 604800 38400
;; Query time: 0 msec
;; SERVER: 172.18.0.2#53(172.18.0.2)
;; WHEN: Sun Jun 20 13:01:21 UTC 2021
;; MSG SIZE rcvd: 113