mirror of
				https://github.com/mail-in-a-box/mailinabox.git
				synced 2025-11-03 19:30:54 +00:00 
			
		
		
		
	Don't fail when resolving zone transfer IP addresses since a nameserver may not have an IPv6 address
This commit is contained in:
		
							parent
							
								
									2f54f39f31
								
							
						
					
					
						commit
						f6f75f6fab
					
				@ -875,11 +875,13 @@ def get_secondary_dns(custom_dns, mode=None):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
			# This is a hostname. Before including in zone xfr lines,
 | 
								# This is a hostname. Before including in zone xfr lines,
 | 
				
			||||||
			# resolve to an IP address. Otherwise just return the hostname.
 | 
								# resolve to an IP address. Otherwise just return the hostname.
 | 
				
			||||||
 | 
								# It may not resolve to IPv6, so don't throw an exception if it
 | 
				
			||||||
 | 
								# doesn't.
 | 
				
			||||||
			if not hostname.startswith("xfr:"):
 | 
								if not hostname.startswith("xfr:"):
 | 
				
			||||||
				if mode == "xfr":
 | 
									if mode == "xfr":
 | 
				
			||||||
					response = dns.resolver.query(hostname+'.', "A")
 | 
										response = dns.resolver.query(hostname+'.', "A", raise_on_no_answer=False)
 | 
				
			||||||
					values.extend(map(str, response))
 | 
										values.extend(map(str, response))
 | 
				
			||||||
					response = dns.resolver.query(hostname+'.', "AAAA")
 | 
										response = dns.resolver.query(hostname+'.', "AAAA", raise_on_no_answer=False)
 | 
				
			||||||
					values.extend(map(str, response))
 | 
										values.extend(map(str, response))
 | 
				
			||||||
					continue
 | 
										continue
 | 
				
			||||||
				values.append(hostname)
 | 
									values.append(hostname)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user