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

Method AuthLookupAddr

framework/dns/dnssec.go:113–140  ·  view source on GitHub ↗
(ctx context.Context, addr string)

Source from the content-addressed store, hash-verified

111}
112
113func (e ExtResolver) AuthLookupAddr(ctx context.Context, addr string) (ad bool, names []string, err error) {
114 revAddr, err := dns.ReverseAddr(addr)
115 if err != nil {
116 return false, nil, err
117 }
118
119 msg := new(dns.Msg)
120 msg.SetQuestion(revAddr, dns.TypePTR)
121 msg.SetEdns0(4096, false)
122 msg.AuthenticatedData = true
123
124 resp, err := e.exchange(ctx, msg)
125 if err != nil {
126 return false, nil, err
127 }
128
129 ad = resp.AuthenticatedData
130 names = make([]string, 0, len(resp.Answer))
131 for _, rr := range resp.Answer {
132 ptrRR, ok := rr.(*dns.PTR)
133 if !ok {
134 continue
135 }
136
137 names = append(names, ptrRR.Ptr)
138 }
139 return
140}
141
142func (e ExtResolver) AuthLookupHost(ctx context.Context, host string) (ad bool, addrs []string, err error) {
143 ad, addrParsed, err := e.AuthLookupIPAddr(ctx, host)

Callers

nothing calls this directly

Calls 1

exchangeMethod · 0.95

Tested by

no test coverage detected