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

Method exchange

framework/dns/dnssec.go:87–111  ·  view source on GitHub ↗
(ctx context.Context, msg *dns.Msg)

Source from the content-addressed store, hash-verified

85}
86
87func (e ExtResolver) exchange(ctx context.Context, msg *dns.Msg) (*dns.Msg, error) {
88 var resp *dns.Msg
89 var lastErr error
90 for _, srv := range e.Cfg.Servers {
91 resp, _, lastErr = e.cl.ExchangeContext(ctx, msg, net.JoinHostPort(srv, e.Cfg.Port))
92 if lastErr != nil {
93 continue
94 }
95
96 if resp.Rcode != dns.RcodeSuccess {
97 lastErr = RCodeError{msg.Question[0].Name, resp.Rcode}
98 continue
99 }
100
101 // Diregard AD flags from non-local resolvers, likely they are
102 // communicated with using an insecure channel and so flags can be
103 // tampered with.
104 if !isLoopback(srv) {
105 resp.AuthenticatedData = false
106 }
107
108 break
109 }
110 return resp, lastErr
111}
112
113func (e ExtResolver) AuthLookupAddr(ctx context.Context, addr string) (ad bool, names []string, err error) {
114 revAddr, err := dns.ReverseAddr(addr)

Callers 7

AuthLookupAddrMethod · 0.95
AuthLookupMXMethod · 0.95
AuthLookupTXTMethod · 0.95
CheckCNAMEADMethod · 0.95
AuthLookupCNAMEMethod · 0.95
AuthLookupIPAddrMethod · 0.95
AuthLookupTLSAMethod · 0.95

Calls 1

isLoopbackFunction · 0.85

Tested by

no test coverage detected