Fix deprecation: use dns.resolver.resolve()

This commit is contained in:
2023-02-21 22:35:27 +13:00
parent e66646b14f
commit b35d50ac81

View File

@@ -30,13 +30,13 @@ def get_directadmin_client(url, username, password):
def getipv6(hostname):
answers = dns.resolver.query(hostname, 'AAAA')
answers = dns.resolver.resolve(hostname, 'AAAA')
for ip in answers:
return str(ip).strip()
def getipv4(hostname):
answers = dns.resolver.query(hostname, 'A')
answers = dns.resolver.resolve(hostname, 'A')
for ip in answers:
return str(ip).strip()