mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-22 02:17:26 +00:00
secondary nameserver check fails if domain has custom DNS (round-robin) multiple A records
fixes #834
This commit is contained in:
parent
cd717ec94e
commit
99d0afd650
@ -881,10 +881,10 @@ def set_secondary_dns(hostnames, env):
|
|||||||
return do_dns_update(env)
|
return do_dns_update(env)
|
||||||
|
|
||||||
|
|
||||||
def get_custom_dns_record(custom_dns, qname, rtype):
|
def get_custom_dns_records(custom_dns, qname, rtype):
|
||||||
for qname1, rtype1, value in custom_dns:
|
for qname1, rtype1, value in custom_dns:
|
||||||
if qname1 == qname and rtype1 == rtype:
|
if qname1 == qname and rtype1 == rtype:
|
||||||
return value
|
yield value
|
||||||
return None
|
return None
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -11,7 +11,7 @@ import dateutil.parser, dateutil.tz
|
|||||||
import idna
|
import idna
|
||||||
import psutil
|
import psutil
|
||||||
|
|
||||||
from dns_update import get_dns_zones, build_tlsa_record, get_custom_dns_config, get_secondary_dns, get_custom_dns_record
|
from dns_update import get_dns_zones, build_tlsa_record, get_custom_dns_config, get_secondary_dns, get_custom_dns_records
|
||||||
from web_update import get_web_domains, get_domains_with_a_records
|
from web_update import get_web_domains, get_domains_with_a_records
|
||||||
from ssl_certificates import get_ssl_certificates, get_domain_ssl_files, check_certificate
|
from ssl_certificates import get_ssl_certificates, get_domain_ssl_files, check_certificate
|
||||||
from mailconfig import get_mail_domains, get_mail_aliases
|
from mailconfig import get_mail_domains, get_mail_aliases
|
||||||
@ -459,7 +459,7 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
|
|||||||
# half working.)
|
# half working.)
|
||||||
|
|
||||||
custom_dns_records = list(get_custom_dns_config(env)) # generator => list so we can reuse it
|
custom_dns_records = list(get_custom_dns_config(env)) # generator => list so we can reuse it
|
||||||
correct_ip = get_custom_dns_record(custom_dns_records, domain, "A") or env['PUBLIC_IP']
|
correct_ip = "; ".join(sorted(get_custom_dns_records(custom_dns_records, domain, "A"))) or env['PUBLIC_IP']
|
||||||
custom_secondary_ns = get_secondary_dns(custom_dns_records, mode="NS")
|
custom_secondary_ns = get_secondary_dns(custom_dns_records, mode="NS")
|
||||||
secondary_ns = custom_secondary_ns or ["ns2." + env['PRIMARY_HOSTNAME']]
|
secondary_ns = custom_secondary_ns or ["ns2." + env['PRIMARY_HOSTNAME']]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user