]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
doco answer
authorBob Halley <halley@dnspython.org>
Mon, 16 Jan 2017 16:27:37 +0000 (08:27 -0800)
committerBob Halley <halley@dnspython.org>
Mon, 16 Jan 2017 16:27:37 +0000 (08:27 -0800)
dns/resolver.py
doc/resolver-class.rst
doc/resolver-functions.rst
doc/resolver.rst

index 4ba171fe8f085ba393ea910093f838b4b2d1992d..ca76a4b4cca63935cbe3ccddd9abb1fa3fedecc6 100644 (file)
 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
 # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
-"""DNS stub resolver.
-
-@var default_resolver: The default resolver object
-@type default_resolver: dns.resolver.Resolver object"""
+"""DNS stub resolver."""
 
 import socket
 import sys
@@ -163,34 +160,19 @@ class NoMetaqueries(dns.exception.DNSException):
 
 
 class Answer(object):
-    """DNS stub resolver answer
+    """DNS stub resolver answer.
 
     Instances of this class bundle up the result of a successful DNS
     resolution.
 
     For convenience, the answer object implements much of the sequence
-    protocol, forwarding to its rrset.  E.g. "for a in answer" is
-    equivalent to "for a in answer.rrset", "answer[i]" is equivalent
-    to "answer.rrset[i]", and "answer[i:j]" is equivalent to
-    "answer.rrset[i:j]".
+    protocol, forwarding to its ``rrset`` attribute.  E.g.
+    ``for a in answer`` is equivalent to ``for a in answer.rrset``.
+    ``answer[i]`` is equivalent to ``answer.rrset[i]``, and
+    ``answer[i:j]`` is equivalent to ``answer.rrset[i:j]``.
 
     Note that CNAMEs or DNAMEs in the response may mean that answer
-    node's name might not be the query name.
-
-    @ivar qname: The query name
-    @type qname: dns.name.Name object
-    @ivar rdtype: The query type
-    @type rdtype: int
-    @ivar rdclass: The query class
-    @type rdclass: int
-    @ivar response: The response message
-    @type response: dns.message.Message object
-    @ivar rrset: The answer
-    @type rrset: dns.rrset.RRset object
-    @ivar expiration: The time when the answer expires
-    @type expiration: float (seconds since the epoch)
-    @ivar canonical_name: The canonical name of the query name
-    @type canonical_name: dns.name.Name object
+    RRset's name might not be the query name.
     """
 
     def __init__(self, qname, rdtype, rdclass, response,
@@ -1091,6 +1073,8 @@ class Resolver(object):
         @type flags: int"""
         self.flags = flags
 
+
+#: The default resolver.
 default_resolver = None
 
 
@@ -1104,8 +1088,10 @@ def get_default_resolver():
 def reset_default_resolver():
     """Re-initialize default resolver.
 
-    resolv.conf will be re-read immediatelly.
+    Note that the resolver configuration (i.e. /etc/resolv.conf on UNIX
+    systems) will be re-read immediately.
     """
+
     global default_resolver
     default_resolver = Resolver()
 
index a5b6c0a4d4a781b934ef6342056fd8b8d890e911..f6e0508628264c38ff5f72146a147e167f2a3167 100644 (file)
@@ -14,3 +14,33 @@ The dns.resolver.Resolver and dns.resolver.Answer Classes
 
 .. autoclass:: dns.resolver.Answer
    :members:
+
+   .. attribute:: qname
+
+      A ``dns.name.Name``, the query name.
+
+   .. attribute:: rdclass
+
+      An ``int``, the query class.
+
+   .. attribute:: rdtype
+
+      An ``int``, the query type.
+
+   .. attribute:: response
+
+      A ``dns.message.Message``, the response message.
+
+   .. attribute:: rrset
+
+      A ``dns.rrset.RRset`` or ``None``, the answer RRset.
+
+   .. attribute:: expiration
+
+      A ``float``, the time when the answer expires.
+
+   .. attribute:: canonical_name
+
+      A ``dns.name.Name``, the canonical name of the query name,
+      i.e. the owner name of the answer RRset after any CNAME and DNAME
+      chaining.
index e4ec1ea7db1f2f2730052b3116f5dec27f87d77a..d3c5dccc6b7ca4f7c10c4f70594c76d74add7efa 100644 (file)
@@ -1,9 +1,10 @@
 .. _resolver-functions:
 
-Resolver Functions
-==================
+Resolver Functions and The Default Resolver
+===========================================
 
 .. autofunction:: dns.resolver.query
 .. autofunction:: dns.resolver.zone_for_name
+.. autodata:: dns.resolver.default_resolver
 .. autofunction:: dns.resolver.get_default_resolver
 .. autofunction:: dns.resolver.reset_default_resolver
index e394d2efa8cdb2188db1989c0aac216352ec55a8..7068bd30399a1834998122dc95359477e03c5f66 100644 (file)
@@ -9,5 +9,6 @@ This is a placeholder.
 .. toctree::
 
    resolver-class
+   resolver-functions
    resolver-caching
    resolver-override