1
0
의 미러 https://github.com/mail-in-a-box/mailinabox.git synced 2026-04-01 21:27:22 +02: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
부모 a70ba94b0c
커밋 626f565be6

파일 보기

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