| 180 | } |
| 181 | |
| 182 | func (e ExtResolver) AuthLookupTXT(ctx context.Context, name string) (ad bool, recs []string, err error) { |
| 183 | msg := new(dns.Msg) |
| 184 | msg.SetQuestion(dns.Fqdn(name), dns.TypeTXT) |
| 185 | msg.SetEdns0(4096, false) |
| 186 | msg.AuthenticatedData = true |
| 187 | |
| 188 | resp, err := e.exchange(ctx, msg) |
| 189 | if err != nil { |
| 190 | return false, nil, err |
| 191 | } |
| 192 | |
| 193 | ad = resp.AuthenticatedData |
| 194 | recs = make([]string, 0, len(resp.Answer)) |
| 195 | for _, rr := range resp.Answer { |
| 196 | txtRR, ok := rr.(*dns.TXT) |
| 197 | if !ok { |
| 198 | continue |
| 199 | } |
| 200 | |
| 201 | recs = append(recs, strings.Join(txtRR.Txt, "")) |
| 202 | } |
| 203 | return |
| 204 | } |
| 205 | |
| 206 | // CheckCNAMEAD is a special function for use in DANE lookups. It attempts to determine final |
| 207 | // (canonical) name of the host and also reports whether the whole chain of CNAME's and final zone |