]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Add a reverse_lookup function to Resolver.
authorThomas Ward <teward@thomas-ward.net>
Mon, 9 Mar 2020 20:14:55 +0000 (16:14 -0400)
committerGitHub <noreply@github.com>
Mon, 9 Mar 2020 20:14:55 +0000 (16:14 -0400)
commitd0a403a0e075482ea98532b65fc20ee94b0f21f3
tree472e032588905ea3e002d635858d2b4ce7b9eb79
parent0991c070f8b3253cc6f30ce5a142b6c52e877859
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.)
dns/resolver.py