From ebce6058631f2c3e81c237f29b03e815f35aeda1 Mon Sep 17 00:00:00 2001 From: Niklas Date: Wed, 24 Feb 2021 14:09:28 +0100 Subject: [PATCH] dont handle missing rr with nxdomain --- internal/authoritative.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/internal/authoritative.go b/internal/authoritative.go index cb6fcc8..be08e48 100644 --- a/internal/authoritative.go +++ b/internal/authoritative.go @@ -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)