[ldns-users] ldns-read-zone output not very helpful
Anand Buddhdev
anandb at ripe.net
Wed Jul 21 09:01:41 UTC 2021
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.
Anand
More information about the ldns-users
mailing list