[client] Support CNAME in local resolver (#3646)

This commit is contained in:
Viktor Liu 2025-04-10 10:38:47 +02:00 committed by GitHub
parent 14913cfa7a
commit d6b0673580
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,6 +71,12 @@ func (d *localResolver) lookupRecords(r *dns.Msg) []dns.RR {
value, found := d.records.Load(key)
if !found {
// alternatively check if we have a cname
if question.Qtype != dns.TypeCNAME {
r.Question[0].Qtype = dns.TypeCNAME
return d.lookupRecords(r)
}
return nil
}