check / check (push) Failing after 2m2s
When the resolver walks from the root servers towards a name, a server that answered SERVFAIL, or referred the query back to its own zone, up or sideways, ended the step, so finding a zone's servers gave up on the zone though its other servers would answer. Such a reply is now passed over for the zone's next server, as a timeout or a refusal already was. To tell a referral that leads closer to the name from one that does not, each walk keeps the zone of the servers it is asking. Other error replies, such as FORMERR, are passed over too. The walk that finds a nameserver's address shares the same server loop, so it changes too. Model: opus-5-5
34 lines
764 B
Go
34 lines
764 B
Go
package resolver
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/miekg/dns"
|
|
)
|
|
|
|
// ExtractRecordValue exports extractRecordValue for testing.
|
|
func ExtractRecordValue(rr dns.RR) string {
|
|
return extractRecordValue(rr)
|
|
}
|
|
|
|
// UsableReply exports usableReply for testing.
|
|
func UsableReply(resp *dns.Msg, zone string, name string) bool {
|
|
return usableReply(resp, zone, name)
|
|
}
|
|
|
|
// CollectIPs exports collectIPs for testing.
|
|
func CollectIPs(
|
|
results map[string]*NameserverResponse,
|
|
) ([]string, string, error) {
|
|
return collectIPs(results)
|
|
}
|
|
|
|
// QueryEachNS exports queryEachNS for testing.
|
|
func (r *Resolver) QueryEachNS(
|
|
ctx context.Context,
|
|
nameservers []string,
|
|
hostname string,
|
|
) (map[string]*NameserverResponse, error) {
|
|
return r.queryEachNS(ctx, nameservers, hostname)
|
|
}
|