Skip to content

Wrong handling of zone cuts

Zone cuts are handled incorrectly in IBDNS.

Consider the following zone file:

$TTL 3600
$ORIGIN test.

delegated2.sub      TXT  "I am still a zone cut no matter what"
                    NS   ns1.delegated2.sub.test.
                    NS   ns2.delegated2.sub.test.
ns1.delegated2.sub  A    198.54.100.11
ns2.delegated2.sub  A    198.54.100.12

Querying delegated2.sub.test should yield a delegation. Here is how NSD answers:

$ dig +nocmd +nostats +norecurse @127.0.2.2 TXT delegated2.sub.test
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 26843
;; flags: qr; QUERY: 1, ANSWER: 0, AUTHORITY: 2, ADDITIONAL: 3

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;delegated2.sub.test.           IN      TXT

;; AUTHORITY SECTION:
delegated2.sub.test.    3600    IN      NS      ns1.delegated2.sub.test.
delegated2.sub.test.    3600    IN      NS      ns2.delegated2.sub.test.

;; ADDITIONAL SECTION:
ns1.delegated2.sub.test. 3600   IN      A       198.54.100.11
ns2.delegated2.sub.test. 3600   IN      A       198.54.100.12

But IBDNS does not include delegated2.sub.test as part of the zone cut and therefore answers incorrectly:

$ dig +nocmd +nostats +norecurse @127.0.2.1 TXT delegated2.sub.test
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 40884
;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;delegated2.sub.test.           IN      TXT

;; ANSWER SECTION:
delegated2.sub.test.    3600    IN      TXT     "I am still a zone cut no matter what"

However, if the TXT resource record is removed from the zone file, IBDNS answers correctly (although without the additional section).