]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Docstring, naming, args/kwargs for reverse_query 418/head
authorThomas Ward <teward@thomas-ward.net>
Mon, 9 Mar 2020 21:37:11 +0000 (17:37 -0400)
committerGitHub <noreply@github.com>
Mon, 9 Mar 2020 21:37:11 +0000 (17:37 -0400)
dns/resolver.py

index 4fd02ef1d771c5e3e89e4c6999c7de83f1d792dc..d1098785a010c90f6f8f32fc98f5081fff3f9c12 100644 (file)
@@ -1030,37 +1030,22 @@ class Resolver(object):
             self.cache.put((_qname, rdtype, rdclass), answer)
         return answer
 
-    def reverse_lookup(self, ipaddr, tcp=False, source=None, 
-                       raise_on_no_answer=True, source_port=0,
-                       lifetime=None):
-        """Use a resolver to run a Reverse IP Lookup for PTR records.
+    def reverse_query(self, ipaddr, *args, **kwargs):
+        """Use a resolver to run a Reverse IP Query for PTR records.
         
-        This utilizes the in-built query function to perform a PTR lookup and 
-        tests to make sure that the entered string is in fact an IP address.
+        This utilizes the in-built query function to perform a PTR lookup on the 
+        specified IP address.
         
         *ipaddr*, a ``str``, the IP address you want to get the PTR record for.
         
-        *tcp*, a ``bool``.  If ``True``, use TCP to make the query.
-        
-        *source*, a ``text`` or ``None``.  If not ``None``, bind to this IP
-        address when making queries.
-        
-        *raise_on_no_answer*, a ``bool``.  If ``True``, raise
-        ``dns.resolver.NoAnswer`` if there's no answer to the question.
-        
-        *source_port*, an ``int``, the port from which to send the message.
-        
-        *lifetime*, a ``float``, how many seconds a query should run before timing out.
+        All other arguments that can be passed to the query function except for
+        rdtype and rdclass are also supported by this function.
         """
                 
         return self.query(dns.reversename.from_address(address), 
                           rdtype=dns.rdatatype.PTR,
                           rdclass=dns.rdataclass.IN,
-                          tcp=tcp,
-                          source=source,
-                          raise_on_no_answer=raise_on_no_answer,
-                          source_port=source_port,
-                          lifetime=lifetime)
+                          *args, **kwargs)
 
     def use_tsig(self, keyring, keyname=None,
                  algorithm=dns.tsig.default_algorithm):