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:
parent
626f565be6
commit
0f713d3c01
@ -875,13 +875,11 @@ def get_secondary_dns(custom_dns, mode=None):
|
|||||||
# resolve to an IP address. Otherwise just return the hostname.
|
# resolve to an IP address. Otherwise just return the hostname.
|
||||||
if not hostname.startswith("xfr:"):
|
if not hostname.startswith("xfr:"):
|
||||||
if mode == "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")
|
response = dns.resolver.query(hostname+'.', "A")
|
||||||
if len(response) == 0:
|
values.extend(map(str, response))
|
||||||
continue
|
response = dns.resolver.query(hostname+'.', "AAAA")
|
||||||
hostname = str(response[0])
|
values.extend(map(str, response))
|
||||||
|
continue
|
||||||
values.append(hostname)
|
values.append(hostname)
|
||||||
|
|
||||||
# This is a zone-xfer-only IP address. Do not return if
|
# This is a zone-xfer-only IP address. Do not return if
|
||||||
|
Loading…
Reference in New Issue
Block a user