summaryrefslogtreecommitdiff
path: root/dns
diff options
context:
space:
mode:
authorBob Halley <halley@dnspython.org>2020-05-19 06:10:21 -0700
committerBob Halley <halley@dnspython.org>2020-05-19 06:10:21 -0700
commit05e080cbaa1dbe8c4b147f2960a5e40d50432fdd (patch)
treed4dc467fceb350c94e885d0481929199b847ff0a /dns
parentd12ea03f2be7240db52a4e1ef49fc6a5d51d9135 (diff)
downloaddnspython-resrefactor.tar.gz
add resolve_address() helper at module levelresrefactor
Diffstat (limited to 'dns')
-rw-r--r--dns/resolver.py10
-rw-r--r--dns/trio/resolver.py10
2 files changed, 20 insertions, 0 deletions
diff --git a/dns/resolver.py b/dns/resolver.py
index 30b554d..4442456 100644
--- a/dns/resolver.py
+++ b/dns/resolver.py
@@ -1243,6 +1243,16 @@ def query(qname, rdtype=dns.rdatatype.A, rdclass=dns.rdataclass.IN,
True)
+def resolve_address(ipaddr, *args, **kwargs):
+ """Use a resolver to run a reverse query for PTR records.
+
+ See ``dns.resolver.Resolver.resolve_address`` for more information on the
+ parameters.
+ """
+
+ return get_default_resolver().resolve_address(ipaddr, *args, **kwargs)
+
+
def zone_for_name(name, rdclass=dns.rdataclass.IN, tcp=False, resolver=None):
"""Find the name of the zone which contains the specified name.
diff --git a/dns/trio/resolver.py b/dns/trio/resolver.py
index 785fde6..6a44545 100644
--- a/dns/trio/resolver.py
+++ b/dns/trio/resolver.py
@@ -188,6 +188,16 @@ async def resolve(qname, rdtype=dns.rdatatype.A, rdclass=dns.rdataclass.IN,
source_port, search)
+async def resolve_address(ipaddr, *args, **kwargs):
+ """Use a resolver to run a reverse query for PTR records.
+
+ See ``dns.trio.resolver.Resolver.resolve_address`` for more
+ information on the parameters.
+ """
+
+ return await get_default_resolver().resolve_address(ipaddr, *args, **kwargs)
+
+
async def zone_for_name(name, rdclass=dns.rdataclass.IN, tcp=False,
resolver=None):
"""Find the name of the zone which contains the specified name.