Thomas Ward [Mon, 9 Mar 2020 21:01:00 +0000 (17:01 -0400)]
Docstrings: Update reverse_lookup docstrings
Pull docstring bits from the query function that are relevant for reverse_lookup as we're now pulling the query function's arguments in (except for rdtype and rdclass) as arguments that can be accepted.
Thomas Ward [Mon, 9 Mar 2020 20:58:11 +0000 (16:58 -0400)]
Use dns.reversename, extend reverse_lookup args
Use inbuilt dns.reversename. Extend the self.query argument bits into the reverse_lookup (tcp, source, raise_on_no_answer, source_port, lifetime), and force-define the rdtype and rdclass.
Thomas Ward [Mon, 9 Mar 2020 20:14:55 +0000 (16:14 -0400)]
Add a reverse_lookup function to Resolver.
Utilize the inbuilt ipaddress library and in-built resolver query libraries to provide a reverse_lookup function. This could make it easier for users to set up their own Resolver instances which continue to behave as stub resolvers but also more easily make PTR record lookups, which would be able to be used as a direct result.
This had been written by me as an extension of the Resolver class in my own private class (called DNSResolver, which I only use internally on a few private applications) which extended the init file to define the nameservers if not specified (default: google DNS) and then extended to add the reverse_lookup function call as well.
Feel free to reject if it doesn't make sense, but it would be a nifty function to have (because `dig` for instance has a `-x` flag you can pass which accepts an IP address and will auto-reverse it to get the in-addr.arpa lookup result from nameservers, whether they're stub resolvers or not, which is a nifty function to have here.)
Emanuel Moser [Mon, 30 Dec 2019 18:50:10 +0000 (19:50 +0100)]
refactoring of dnssec documentation
- replaces old comments with sphinx style comments
- adds support for sphinx.ext.todo
- since `_validate()` and `_validate_rrsig()` are only internal functions they are removed from documentation
Brian Wellington [Fri, 30 Aug 2019 18:42:12 +0000 (11:42 -0700)]
Improve TCP connect behavior.
Before this change, the _connect() method would start the connection
process, but not wait for it to complete. This would leave the socket
in an indeterminate state until some other code checked for writability,
and would lose the error code if the connect failed.
This changes _connect() to wait for the connection to complete, and
raises and exception with the appropriate error code if it fails.
Bob Halley [Fri, 3 May 2019 15:17:54 +0000 (08:17 -0700)]
The EDNS0 client-subnet code didn't work correctly for addresses that
were not a multiple of 8 bits.
Instead of preserving the required number of high-order bits, it
cleared that number of low-order bits. Thanks to Brian Wellington for
discovering this and providing the correct code.
Need to also check that last TTL is known before using it as a fallback, otherwise ttl is never None in the last check, setting it incorrectly to 0 instead.
Instead of moving the entire TTL parsing past the rdata handling (causing the RR to be parsed on the wrong way), returned the parsing to its original location, and only moved the final failure code past the rdata handling.
By doing the TTL validity check after parsing the record data allows the TTL to be set properly from SOA RDATA even when the SOA record itself does not have TTL set.
DNS-Leo [Mon, 18 Mar 2019 17:43:36 +0000 (18:43 +0100)]
Create NINFO.py
Added NINFO record - assigned as type 56 by IANA
See:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
https://www.iana.org/assignments/dns-parameters/NINFO/ninfo-completed-template
https://tools.ietf.org/html/draft-reid-dnsext-zs-01
DNS-Leo [Mon, 18 Mar 2019 17:36:36 +0000 (18:36 +0100)]
Update rdatatype.py
Added NINFO (identical to TXT), assigned as type 56 by IANA.
See:
https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
https://www.iana.org/assignments/dns-parameters/NINFO/ninfo-completed-template
https://tools.ietf.org/html/draft-reid-dnsext-zs-01