mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	Fix an issue when Secondary NS has multiple A records (#1633)
If a custom secondary NS server has multiple A records status_checks.py will fail with a timeout and Web UI won't load.
This commit is contained in:
		
							parent
							
								
									295d481603
								
							
						
					
					
						commit
						08021ea19f
					
				@ -486,10 +486,12 @@ def check_dns_zone(domain, env, output, dns_zonefiles):
 | 
			
		||||
	if custom_secondary_ns and not probably_external_dns:
 | 
			
		||||
		for ns in custom_secondary_ns:
 | 
			
		||||
			# We must first resolve the nameserver to an IP address so we can query it.
 | 
			
		||||
			ns_ip = query_dns(ns, "A")
 | 
			
		||||
			if not ns_ip:
 | 
			
		||||
			ns_ips = query_dns(ns, "A")
 | 
			
		||||
			if not ns_ips:
 | 
			
		||||
				output.print_error("Secondary nameserver %s is not valid (it doesn't resolve to an IP address)." % ns)
 | 
			
		||||
				continue
 | 
			
		||||
			# Choose the first IP if nameserver returns multiple
 | 
			
		||||
			ns_ip = ns_ips.split('; ')[0]
 | 
			
		||||
 | 
			
		||||
			# Now query it to see what it says about this domain.
 | 
			
		||||
			ip = query_dns(domain, "A", at=ns_ip, nxdomain=None)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user