Skip to content
Snippets Groups Projects
Commit 2ded47fb authored by ale's avatar ale
Browse files

return NXDOMAIN for all unknown queries

parent 166f4a63
Branches
No related tags found
No related merge requests found
......@@ -177,6 +177,11 @@ func (d *DnsRedirector) serveDNS(w dns.ResponseWriter, req *dns.Msg) {
m.Answer = append(m.Answer, rec)
}
responseMsg = fmt.Sprintf("%v", ips)
default:
// Return an error for anything else.
m.SetRcode(req, dns.RcodeNameError)
responseMsg = "NXDOMAIN"
}
log.Printf("[%d] %s.%s %s (from %s) -> %s", req.MsgHdr.Id, query, d.origin, dns.TypeToString[req.Question[0].Qtype], w.RemoteAddr(), responseMsg)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment