Bring back use of dnspython for A/AAAA resolution.

This is behind a use_dnspython flag, however, so it can be disabled as
desired.
This commit is contained in:
Lance Stout
2014-06-08 19:51:57 -07:00
parent 02f79fc94b
commit ad91a8cd5e
2 changed files with 90 additions and 27 deletions

View File

@@ -224,6 +224,11 @@ class XMLStream(object):
#: If set to ``True``, attempt to use IPv6.
self.use_ipv6 = True
#: If set to ``True``, allow using the ``dnspython`` DNS library
#: if available. If set to ``False``, the builtin DNS resolver
#: will be used, even if ``dnspython`` is installed.
self.use_dnspython = True
#: Use CDATA for escaping instead of XML entities. Defaults
#: to ``False``.
self.use_cdata = False
@@ -1081,7 +1086,8 @@ class XMLStream(object):
return resolve(domain, port, service=self.dns_service,
resolver=resolver,
use_ipv6=self.use_ipv6)
use_ipv6=self.use_ipv6,
use_dnspython=self.use_dnspython)
def pick_dns_answer(self, domain, port=None):
"""Pick a server and port from DNS answers.