Fix dns query for old dnspython lib
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
bb1d4f6dc7
commit
e1c79db857
@ -41,13 +41,13 @@ class DNSAdapter(adapters.HTTPAdapter):
|
|||||||
|
|
||||||
if HAS_IPV6:
|
if HAS_IPV6:
|
||||||
try:
|
try:
|
||||||
answers_v6 = DNS_RESOLVER.resolve(host, rdatatype.AAAA)
|
answers_v6 = DNS_RESOLVER.query(host, rdatatype.AAAA)
|
||||||
for rdata_v6 in answers_v6:
|
for rdata_v6 in answers_v6:
|
||||||
return f"[{str(rdata_v6)}]"
|
return f"[{str(rdata_v6)}]"
|
||||||
except resolver.NoAnswer:
|
except resolver.NoAnswer:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
answers_v4 = DNS_RESOLVER.resolve(host, rdatatype.A)
|
answers_v4 = DNS_RESOLVER.query(host, rdatatype.A)
|
||||||
for rdata_v4 in answers_v4:
|
for rdata_v4 in answers_v4:
|
||||||
return str(rdata_v4)
|
return str(rdata_v4)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user