saghul / pycares

Python interface for c-ares
https://pypi.org/project/pycares/
MIT License
165 stars 73 forks source link

parsing of ANY queries broken #108

Closed mutax closed 3 years ago

mutax commented 4 years ago

The way answers to ANY queries are being parsed is completely bogus.

The codes just tries all parsers on the DNS reply and accepts what ever any parser returns.

In my case it leads to nameserver records in the authority section being parsed as SOA record which makes absolutely no sense.

Please check the code in adig from c-ares for a better way of handling this - there the ressource records are first examined and then the appropriate parser is being called.

saghul commented 4 years ago

Patches are welcome :-)

mutax commented 4 years ago

Currently -ENOTIME. Sorry. Fix would be to dissect the sections from the answer and additional section, check the RR type and then parse the answer. The way c-ares is doing it might be considered a bit questionable here as well, as there is no easy way to tell, if a record is from the answer or additional section.