While parsing the zonefile, default $TTL is not used on all RRs with TTL omitted. Instead, it seems that the TTL of the previous record is used.
For example, with this zonefile:
$TTL 300
@ IN SOA dns.example.com. hostmaster.example.com. (11111 10800 3600 604800 3600)
@ 86400 IN NS ns.example.com.
ns IN A 1.1.1.1
www IN A 2.2.2.2
On nsd <= 4.9.1, TTL of the last two A records (ns and www) is 300, as I am expecting.
output of nsd-checkzone -p example.com /root/example.zone:
$ORIGIN com.
example 300 IN SOA dns.example.com. hostmaster.example.com. (
11111 10800 3600 604800 3600 )
86400 IN NS ns.example.com.
$ORIGIN example.com.
ns 300 IN A 1.1.1.1
www 300 IN A 2.2.2.2
; zone example.com is ok
But on nsd >= 4.10.0 (test on 4.10.0 and 4.10.1), it became 86400.
$ORIGIN com.
example 300 IN SOA dns.example.com. hostmaster.example.com. (
11111 10800 3600 604800 3600 )
86400 IN NS ns.example.com.
$ORIGIN example.com.
ns 86400 IN A 1.1.1.1
www 86400 IN A 2.2.2.2
; zone example.com is ok
While parsing the zonefile, default $TTL is not used on all RRs with TTL omitted. Instead, it seems that the TTL of the previous record is used.
For example, with this zonefile:
On nsd <= 4.9.1, TTL of the last two A records (ns and www) is 300, as I am expecting. output of
nsd-checkzone -p example.com /root/example.zone
:But on nsd >= 4.10.0 (test on 4.10.0 and 4.10.1), it became 86400.