resolver: a nameserver is asked at each of its addresses in turn (closes #285)
check / check (push) Canceled after 0s

A nameserver's queries went only to the first IPv4 address its name
resolves to, so one unreachable address made it fail whenever that
address came first in the answer. Each record type is now asked at the
addresses one at a time until one gives a usable reply, and the next
type is asked first at the address that gave it. The README's DNS
Resolution Strategy says which addresses are asked.

Model: opus-5-5
This commit is contained in:
2026-10-15 10:17:14 +00:00
parent b79726acc6
commit 623e7b2c69
5 changed files with 130 additions and 33 deletions
+11
View File
@@ -96,6 +96,17 @@ func (r *Resolver) QueryServers(
return r.queryServers(ctx, servers, zone, name, qtype)
}
// QueryTypes exports queryTypes for testing.
func (r *Resolver) QueryTypes(
ctx context.Context,
nsHostname string,
nsIPs []string,
hostname string,
qtypes []uint16,
) (*NameserverResponse, error) {
return r.queryTypes(ctx, nsHostname, nsIPs, hostname, qtypes)
}
// QueryEachNS exports queryEachNS for testing.
func (r *Resolver) QueryEachNS(
ctx context.Context,