MCPcopy Create free account
hub / github.com/foxcpp/maddy / AuthLookupCNAME

Method AuthLookupCNAME

framework/dns/dnssec.go:250–269  ·  view source on GitHub ↗
(ctx context.Context, host string)

Source from the content-addressed store, hash-verified

248}
249
250func (e ExtResolver) AuthLookupCNAME(ctx context.Context, host string) (ad bool, cname string, err error) {
251 msg := new(dns.Msg)
252 msg.SetQuestion(dns.Fqdn(host), dns.TypeCNAME)
253 msg.SetEdns0(4096, false)
254 msg.AuthenticatedData = true
255 resp, err := e.exchange(ctx, msg)
256 if err != nil {
257 return false, "", err
258 }
259
260 for _, r := range resp.Answer {
261 cnameR, ok := r.(*dns.CNAME)
262 if !ok {
263 continue
264 }
265 return resp.AuthenticatedData, cnameR.Target, nil
266 }
267
268 return resp.AuthenticatedData, "", nil
269}
270
271func (e ExtResolver) AuthLookupIPAddr(ctx context.Context, host string) (ad bool, addrs []net.IPAddr, err error) {
272 // First, query IPv6.

Callers

nothing calls this directly

Calls 1

exchangeMethod · 0.95

Tested by

no test coverage detected