dont handle missing rr with nxdomain

This commit is contained in:
Niklas 2021-02-24 14:09:28 +01:00
parent 7255fc02c8
commit ebce605863

View File

@ -121,7 +121,15 @@ func handleRequest(w dns.ResponseWriter, r *dns.Msg, zone zoneView) {
}
if len(m.Answer) == 0 {
m.SetRcode(m, dns.RcodeNameError)
var soa dns.RR
for _, v := range zone.rr[dns.TypeSOA] {
if len(v) == 1 {
soa = v[0]
}
}
if soa != nil {
m.Extra = append(m.Extra, soa)
}
}
w.WriteMsg(m)