]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
add resolve_address() helper at module level 472/head
authorBob Halley <halley@dnspython.org>
Tue, 19 May 2020 13:10:21 +0000 (06:10 -0700)
committerBob Halley <halley@dnspython.org>
Tue, 19 May 2020 13:10:21 +0000 (06:10 -0700)
dns/resolver.py
dns/trio/resolver.py

index 30b554d00ce6c95960684f7b764abe9070a746e6..4442456c8fa6127aa158f1ad4ab82dfbf61051ec 100644 (file)
@@ -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.
 
index 785fde671ccb1b6ba5ff323b0a743605aa8051dc..6a4454580bfd40e18f9836a3f8bfeaabdeb0aa4d 100644 (file)
@@ -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.