1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-20 02:52:11 +00:00

management/dns_update.py.get_secondary_dns: changed to additionally query IPv6 address

This commit is contained in:
notEvil 2019-09-14 17:09:05 +02:00
parent a70ba94b0c
commit 626f565be6

View File

@ -875,7 +875,12 @@ 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.append(hostname)