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

Method AuthLookupMX

framework/dns/dnssec.go:155–180  ·  view source on GitHub ↗
(ctx context.Context, name string)

Source from the content-addressed store, hash-verified

153}
154
155func (e ExtResolver) AuthLookupMX(ctx context.Context, name string) (ad bool, mxs []*net.MX, err error) {
156 msg := new(dns.Msg)
157 msg.SetQuestion(dns.Fqdn(name), dns.TypeMX)
158 msg.SetEdns0(4096, false)
159 msg.AuthenticatedData = true
160
161 resp, err := e.exchange(ctx, msg)
162 if err != nil {
163 return false, nil, err
164 }
165
166 ad = resp.AuthenticatedData
167 mxs = make([]*net.MX, 0, len(resp.Answer))
168 for _, rr := range resp.Answer {
169 mxRR, ok := rr.(*dns.MX)
170 if !ok {
171 continue
172 }
173
174 mxs = append(mxs, &net.MX{
175 Host: mxRR.Mx,
176 Pref: mxRR.Preference,
177 })
178 }
179 return
180}
181
182func (e ExtResolver) AuthLookupTXT(ctx context.Context, name string) (ad bool, recs []string, err error) {
183 msg := new(dns.Msg)

Callers

nothing calls this directly

Calls 1

exchangeMethod · 0.95

Tested by

no test coverage detected