diff --git a/internal/cooldns.go b/internal/cooldns.go index 1c8ae35..b6d93af 100644 --- a/internal/cooldns.go +++ b/internal/cooldns.go @@ -409,6 +409,14 @@ func handleRequest(w dns.ResponseWriter, r *dns.Msg, zone zoneView) { m.Extra = append(m.Extra, zone.rr[dns.TypeAAAA][t.Ns]...) } } + case dns.TypeCNAME: + // Resolve CNAME + for _, cnameRR := range m.Answer { + if t, ok := cnameRR.(*dns.CNAME); ok { + m.Extra = append(m.Extra, zone.rr[dns.TypeA][t.Target]...) + m.Extra = append(m.Extra, zone.rr[dns.TypeAAAA][t.Target]...) + } + } } if len(m.Answer) == 0 {