[ldns-users] ldns-read-zone output not very helpful

Wouter Wijngaards wouter at nlnetlabs.nl
Wed Jul 21 09:21:48 UTC 2021


Hi Anand,

On 21/07/2021 11:01, Anand Buddhdev via ldns-users wrote:
> On 21/07/2021 10:43, Wouter Wijngaards via ldns-users wrote:
> 
> Hi Wouter,
> 
>>> Line 3638 is actually a blank line! Here are the lines before and after it:
>>>
>>> 3636 reg01-test.atlas    86400   A       193.0.19.181
>>> 3637 reg01-test.atlas    86400   AAAA    2001:67c:2e8:11::193.0.19.181
>>> 3638
>>> 3639 reg02-test.atlas    86400   A       193.0.19.26
>>> 3640 reg02-test.atlas    86400   AAAA    2001:67c:2e8:11::193.0.19.26
>>
>> So the error happens because the code is trying to read the class but
>> this fails. To be precise: the owner name can be read. The TTL can be
>> read, and if it exists, it parses. But when it then attempts to read the
>> next token, for the class, that token cannot be read.
>>
>> You skip the class token and have a type token. But the token itself
>> cannot be read, I mean it skips spaces and tabs but then fails. So the
>> token fetch failed at the class position.
>>
>> Perhaps there is data there, but there is whitespace on the line. And
>> the empty spaces are read as an owner and TTL, empty values, and then
>> the class token read finds the end of the buffer and this fails with the
>> syntax error.
>>
>> Or there could be invisible unicode characters in the sourcefile. But I
>> do not immediately see what codepath would then print this error.
> 
> I have just checked the file again. Around the line where ldns reports
> this error, I do not see anything strange. Line 3638 is truly blank, as
> in, it contains just a newline character, and nothing else.
> 
> The zone file has several $INCLUDE directives, and some of the included
> files have $GENERATE directives in them. Could ldns be getting confused
> by these? Could it also be reporting the line number *after* including
> the files? That would explain why I can't find anything obvious.

ldns-read-zone does not support the include and should return an error,
in zone.c:262, there it fails for an include directive. Also for the
generate directive, that should have been a syntax error. Is it reading
a different, processed, file?

Best regards, Wouter

> 
> Anand
> _______________________________________________
> 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