Refuse dynamic updates properly (#124)

This commit is contained in:
Joona Hoikkala 2018-10-31 15:01:42 +02:00 committed by GitHub
parent 1d85bf75b0
commit 3bb130d055
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -303,6 +303,7 @@ logformat = "text"
- unreleased
- New
- Command line flag `-c` to specify location of config file.
- Proper refusal of dynamic update requests.
- v0.5
- New
- Configurable certificate cache directory

4
dns.go
View File

@ -56,7 +56,6 @@ func answer(q dns.Question) ([]dns.RR, int, error) {
if !ok {
rcode = dns.RcodeNameError
}
}
log.WithFields(log.Fields{"qtype": dns.TypeToString[rtype], "domain": domain, "rcode": dns.RcodeToString[rcode]}).Debug("Answering question for domain")
return r, rcode, nil
@ -68,6 +67,9 @@ func handleRequest(w dns.ResponseWriter, r *dns.Msg) {
if r.Opcode == dns.OpcodeQuery {
readQuery(m)
} else if r.Opcode == dns.OpcodeUpdate {
log.Debug("Refusing DNS Dynamic update request")
m.MsgHdr.Rcode = dns.RcodeRefused
}
w.WriteMsg(m)