From 0f713d3c01f0206459461a0dbfadca6fc715cc55 Mon Sep 17 00:00:00 2001 From: notEvil Date: Wed, 9 Oct 2019 12:01:03 +0200 Subject: [PATCH] - management/dns_update.py.get_secondary_dns: changed to return all IPv4 and IPv6 addresses --- management/dns_update.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/management/dns_update.py b/management/dns_update.py index 66cc172e..762c4719 100755 --- a/management/dns_update.py +++ b/management/dns_update.py @@ -875,13 +875,11 @@ def get_secondary_dns(custom_dns, mode=None): # resolve to an IP address. Otherwise just return the hostname. if not hostname.startswith("xfr:"): if mode == "xfr": - ipv6_response = dns.resolver.query(hostname+'.', "AAAA") - if len(ipv6_response) != 0: - values.append(str(ipv6_response[0])) response = dns.resolver.query(hostname+'.', "A") - if len(response) == 0: - continue - hostname = str(response[0]) + values.extend(map(str, response)) + response = dns.resolver.query(hostname+'.', "AAAA") + values.extend(map(str, response)) + continue values.append(hostname) # This is a zone-xfer-only IP address. Do not return if