NSloggingconfiguration不工作在绑定(bind9)在Ubuntu上

我有以下区域文件:

testzone.local. IN SOA MyUbuntu hostname ( 6 ; Serial 3h ; Refresh after 3 hours 1h ; Retry after 1 hour 1w ; Expire after 1 week 1h ) ; Negative caching TTL of 1 hour ;---------------- records -------------- b._dns-sd._udp IN PTR device-discovery lb._dns-sd._udp IN PTR device-discovery device-discovery IN NS test-server-host test-server-host IN A 192.168.1.10 ;--------------- End of records --------- ; ; Name servers ; @ IN NS MyUbuntu MyUbuntu IN A 192.168.1.28 devicemachine IN A 192.168.1.10 

b._dns-sd._udp.testzone.local给出了b._dns-sd._udp.testzone.locallb._dns-sd._upd.testzone.localtest-server-host答案,但不是为device-discovery.testzone.local. 以下是我挖掘device-discovery.testzone.local NS的结果

 kg@MyUbuntu:~$ dig @localhost NS device-discovery.testzone.local ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @localhost NS device-discovery.testzone.local ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 13783 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;device-discovery.testzone.local. IN NS ;; Query time: 3 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Fri Feb 17 07:35:27 AEDT 2017 ;; MSG SIZE rcvd: 64 

区域文件有什么问题吗? 我在网上看到很多例子,我期待它的工作。

非常感谢。

更新的区域文件位,仍然不工作

 kg@MyUbuntu:/etc/bind/zones$ cat db.testzone.local testzone.local. IN SOA MyUbuntu hostname ( 9 ; Serial 3h ; Refresh after 3 hours 1h ; Retry after 1 hour 1w ; Expire after 1 week 1h ) ; Negative caching TTL of 1 hour testzone.local. IN NS MyUbuntu.testzone.local. testzone.local. IN NS hostname.testzone.local. b._dns-sd._udp IN PTR device-discovery lb._dns-sd._udp IN PTR device-discovery device-discovery IN NS test-server-host test-server-host IN A 192.168.1.10 ; ; Name servers ; @ IN NS MyUbuntu MyUbuntu IN A 192.168.1.28 hostname IN A 192.168.1.28 kg@ MyUbuntu:/etc/bind/zones$ named-checkzone testzone.local db.testzone.local db.testzone.local:1: no TTL specified; using SOA MINTTL instead zone testzone.local/IN: loaded serial 9 OK kg@ MyUbuntu:/etc/bind/zones$ sudo service bind9 restart kg@ MyUbuntu:/etc/bind/zones$ sudo service bind9 status ● bind9.service - BIND Domain Name Server Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: enabl Active: active (running) since Fri 2017-02-17 11:55:59 AEDT; 5s ago Docs: man:named(8) Process: 5402 ExecStop=/usr/sbin/rndc stop (code=exited, status=0/SUCCESS) Main PID: 5407 (named) Tasks: 5 (limit: 9830) CGroup: /system.slice/bind9.service └─5407 /usr/sbin/named -f -u bind Feb 17 11:55:59 MyUbuntu named[5407]: managed-keys-zone: loaded serial 41 Feb 17 11:55:59 MyUbuntu named[5407]: zone 0.in-addr.arpa/IN: loaded serial Feb 17 11:56:00 MyUbuntu named[5407]: /etc/bind/zones/db.testzone.local:1: n Feb 17 11:56:00 MyUbuntu named[5407]: zone testzone.local/IN: loaded serial Feb 17 11:56:00 MyUbuntu named[5407]: zone localhost/IN: loaded serial 2 Feb 17 11:56:00 MyUbuntu named[5407]: zone 127.in-addr.arpa/IN: loaded seria Feb 17 11:56:00 MyUbuntu named[5407]: zone 255.in-addr.arpa/IN: loaded seria Feb 17 11:56:00 MyUbuntu named[5407]: all zones loaded Feb 17 11:56:00 MyUbuntu named[5407]: running Feb 17 11:56:00 MyUbuntu named[5407]: zone testzone.local/IN: sending notifi kg@ MyUbuntu:/etc/bind/zones$ dig @localhost device-discovery.testzone.local. NS ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @localhost device-discovery.testzone.local. NS ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 52820 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;device-discovery.testzone.local. IN NS ;; Query time: 15 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Fri Feb 17 11:57:02 AEDT 2017 ;; MSG SIZE rcvd: 64 

这是通过为分区创build一个区域文件来解决的。

我需要为子区域创build一个区域文件:device-discovery.testzone.local并将区域信息添加到named.conf.local

在subzone的区域文件中,我将device-discovery.testzone.local的名称服务器定义为test-server-host.testzone.local。 有效!

dig观点似乎是失序的。 要查询DNSloggingtypes,请在types前指定域名 – 使用dig @nameserver some.domain. type dig @nameserver some.domain. type 。 在你的例子中,试着dig @localhost device-discovery.testzone.local. NS dig @localhost device-discovery.testzone.local. NS