1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-29 04:17:07 +00:00

- management/dns_update.py.get_secondary_dns: changed to return all IPv4 and IPv6 addresses

This commit is contained in:
notEvil 2019-10-09 12:01:03 +02:00
parent 626f565be6
commit 0f713d3c01

View File

@ -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