[ldns-users] ldns & TTL

Willem Toorop willem at nlnetlabs.nl
Wed Nov 24 16:05:13 UTC 2021


Hi Andreas,

Op 24-11-2021 om 16:54 schreef A. Schulze via ldns-users:
> Hello,
> 
> in a discussion about valid TTL values I noted unexpected output while feeding different TTL into ldns-read-zone.
> 
> To reproduce use something like this:
> TTL=$( echo 'value' | bc ); echo "foo $TTL TXT \"TTL=$TTL\"" | ldns-read-zone 
> 
> value       output
> ------------------------------------------------------------------
> 2^31 - 1    foo.    2147483647      IN      TXT     "TTL=2147483647"
> 2^31        foo.    -2147483648     IN      TXT     "TTL=2147483648"
> 2^31 + 1    foo.    -2147483647     IN      TXT     "TTL=2147483649"
> 
> 2^32 - 1    foo.    -1              IN      TXT     "TTL=4294967295"
> 2^32        foo.    0               IN      TXT     "TTL=4294967296"
> 2^32 + 1    foo.    1               IN      TXT     "TTL=4294967297"
> 
> RFC 1035 define a TTL as "positive values of a signed 32 bit number"
> which mean to me, anything larger then 2^31 - 1 is invalid.

There has been an errata (in 2012) changing this to an unsigned 32 bit
number: https://www.rfc-editor.org/errata/eid2130

So ldns is printing it wrong! I'll fix that.
Just in time for the 1.8.0 release!

Thanks,
-- Willem


> 
> Could the readers please clarify about
>  - the maximum value per RFC
>  - whether these output of ldns-read-zone is correct
> 
> Btw: I used ldns-1.8.0-rc.2
> 
> Thanks,
> Andreas
> 
> 
> _______________________________________________
> ldns-users mailing list
> ldns-users at lists.nlnetlabs.nl
> https://lists.nlnetlabs.nl/mailman/listinfo/ldns-users
> 


More information about the ldns-users mailing list