Last explicit TTL is used instead of $TTL
3.1.0 includes this change:
omitted TTL value is correctly set to the last explicitly stated value (RFC 1035)
I think the value of the $TTL
directive, if set, should be used instead. That would be consistent with Knot DNS 3.0.8, PowerDNS Authoritative Server, and BIND's documentation. (I didn't check BIND's implementation.)
I think $TTL
is nonstandard, so there's no official reference for what to do.
Example zone:
$ORIGIN example.com.
$TTL 3600
@ SOA example.com. dnsadmin.example.net. 1 1800 900 2678400 3600
@ 7200 NS example.com.
@ AAAA 2001:db8::
In Knot DNS 3.0.8 (I believe) and PowerDNS Authoritative Server, the TTL of example.com.
/AAAA
would be 3600
. In Knot DNS 3.1.0, it's 7200
.
BIND's documentation says:
The $TTL directive at the top of the zone file (before the SOA) gives a default TTL for every RR without a specific TTL set.