[ldns-users] TTL Parsing

Tony Finch dot at dotat.at
Thu Sep 20 15:44:34 UTC 2018

Charles Hubbard <charles.hubbard at edgeintelligence.com> wrote:
> I noticed that the TTL is defined as a signed int32
> https://www.ietf.org/rfc/rfc1035.txt
> but as an unsigned int32 by ldns.
> Is this a bug?

RFC 2181 says it is a bug in RFC 1035 :-)


   The definition of values appropriate to the TTL field in STD 13 is
   not as clear as it could be, with respect to how many significant
   bits exist, and whether the value is signed or unsigned.  It is
   hereby specified that a TTL value is an unsigned number, with a
   minimum value of 0, and a maximum value of 2147483647.  That is, a
   maximum of 2^31 - 1.  When transmitted, this value shall be encoded
   in the less significant 31 bits of the 32 bit TTL field, with the
   most significant, or sign, bit set to zero.

   Implementations should treat TTL values received with the most
   significant bit set as if the entire value received was zero.

f.anthony.n.finch  <dot at dotat.at>  http://dotat.at/
Rockall, Malin: West, veering northwest, 5 to 7, increasing gale 8 at times.
Rough or very rough, occasionally moderate in Malin. Squally showers. Moderate
or good.

More information about the ldns-users mailing list