mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +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.
 | 
			
		||||
			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:
 | 
			
		||||
					values.extend(map(str, response))
 | 
			
		||||
					response = dns.resolver.query(hostname+'.', "AAAA")
 | 
			
		||||
					values.extend(map(str, response))
 | 
			
		||||
					continue
 | 
			
		||||
					hostname = str(response[0])
 | 
			
		||||
				values.append(hostname)
 | 
			
		||||
 | 
			
		||||
			# This is a zone-xfer-only IP address. Do not return if
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user