[client] Normalize DNS record names to lowercase in local handler update (#3323)

* [client] Normalize DNS record names to lowercase in lookup
This commit is contained in:
hakansa
2025-02-14 13:13:40 +03:00
committed by GitHub
parent c4a6dafd27
commit 039a985f41
2 changed files with 3 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package dns
import (
"fmt"
"strings"
"sync"
"github.com/miekg/dns"
@@ -60,6 +61,7 @@ func (d *localResolver) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
func (d *localResolver) lookupRecord(r *dns.Msg) dns.RR {
question := r.Question[0]
question.Name = strings.ToLower(question.Name)
record, found := d.records.Load(buildRecordKey(question.Name, question.Qclass, question.Qtype))
if !found {
return nil