check / check (push) Successful in 1m37s
LookupAllRecords now returns each nameserver's response, so the watcher saves its status: ok when it answered, NXDOMAIN and no records included, and error with the reason when it timed out, answered SERVFAIL or REFUSED, or could not be reached. A nameserver that starts failing sends NS Failure and one that answers again sends NS Recovery. A failing nameserver is left out of the record change and inconsistency comparisons. The resolver used to report REFUSED and network errors as an answer with no records; they are now errors. A lookup cut short by its context now returns an error instead of a failure of the nameserver it was querying. Model: opus-5-5
22 lines
445 B
Go
22 lines
445 B
Go
package resolver
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/miekg/dns"
|
|
)
|
|
|
|
// ExtractRecordValue exports extractRecordValue for testing.
|
|
func ExtractRecordValue(rr dns.RR) string {
|
|
return extractRecordValue(rr)
|
|
}
|
|
|
|
// 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)
|
|
}
|