1

I have following zone file:

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

Dig gives answers for b._dns-sd._udp.testzone.local, lb._dns-sd._upd.testzone.local and test-server-host but not for device-discovery.testzone.local. Following is the result when I do a dig for 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

Is there anything wrong in the zone file? I saw lots of examples on web and I was expecting it to work.

Thanks a lot.

UPDATED ZONE FILE A BIT, STILL NOT WORKING

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
Kumar Gaurav
  • 121
  • 4
  • After changing your zone, did you update your serial number? Did you reload bind? Did you examine your syslog to see if bind reported and syntax errors or other problems with your zone? – Zoredache Feb 16 '17 at 21:38
  • yes, I am doing that. check the update in original question. also no error in syslog. – Kumar Gaurav Feb 17 '17 at 01:10

2 Answers2

0

This was solved by having a zone file for the subzone.

I needed to create a zone file for the subzone: device-discovery.testzone.local and added the zone information to named.conf.local

In the zone file for subzone, I defined the nameserver for device-discovery.testzone.local as test-server-host.testzone.local. It worked!

Kumar Gaurav
  • 121
  • 4
-2

Your arguments to dig seem to be out of order. To query for a type of DNS record, specify the domain name before the type -- use dig @nameserver some.domain. type. In the case of your example, try dig @localhost device-discovery.testzone.local. NS

Mox
  • 415
  • 1
  • 3
  • 8