Merge pull request #253 from kxepal/patch-1

Don't resolve AAAA records if there is no dnspython nor IPv6 support
This commit is contained in:
Lance Stout 2013-07-29 09:54:40 -07:00
commit afd48b9e08

View File

@ -202,6 +202,9 @@ def get_AAAA(host, resolver=None):
# If not using dnspython, attempt lookup using the OS level
# getaddrinfo() method.
if resolver is None:
if not socket.has_ipv6:
log.debug("Unable to query %s for AAAA records: IPv6 is not supported", host)
return []
try:
recs = socket.getaddrinfo(host, None, socket.AF_INET6,
socket.SOCK_STREAM)