Return NXDOMAIN if no records are returned

This commit is contained in:
Lauri Võsandi 2021-07-05 15:09:32 +03:00
parent 2c93312d74
commit d74fcd0a47

View File

@ -69,6 +69,7 @@ func query(tp string, name string, m *dns.Msg, coll *mongo.Collection) {
log.Fatal(err)
}
if appendResults(tp, name, m, cur) == 0 {
m.Rcode = dns.RcodeNameError
counterNoResults.Inc()
} else {
counterAlternativeNames.Inc()