Refuse dynamic updates properly (#124)
This commit is contained in:
parent
1d85bf75b0
commit
3bb130d055
@ -303,6 +303,7 @@ logformat = "text"
|
|||||||
- unreleased
|
- unreleased
|
||||||
- New
|
- New
|
||||||
- Command line flag `-c` to specify location of config file.
|
- Command line flag `-c` to specify location of config file.
|
||||||
|
- Proper refusal of dynamic update requests.
|
||||||
- v0.5
|
- v0.5
|
||||||
- New
|
- New
|
||||||
- Configurable certificate cache directory
|
- Configurable certificate cache directory
|
||||||
|
|||||||
4
dns.go
4
dns.go
@ -56,7 +56,6 @@ func answer(q dns.Question) ([]dns.RR, int, error) {
|
|||||||
if !ok {
|
if !ok {
|
||||||
rcode = dns.RcodeNameError
|
rcode = dns.RcodeNameError
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
log.WithFields(log.Fields{"qtype": dns.TypeToString[rtype], "domain": domain, "rcode": dns.RcodeToString[rcode]}).Debug("Answering question for domain")
|
log.WithFields(log.Fields{"qtype": dns.TypeToString[rtype], "domain": domain, "rcode": dns.RcodeToString[rcode]}).Debug("Answering question for domain")
|
||||||
return r, rcode, nil
|
return r, rcode, nil
|
||||||
@ -68,6 +67,9 @@ func handleRequest(w dns.ResponseWriter, r *dns.Msg) {
|
|||||||
|
|
||||||
if r.Opcode == dns.OpcodeQuery {
|
if r.Opcode == dns.OpcodeQuery {
|
||||||
readQuery(m)
|
readQuery(m)
|
||||||
|
} else if r.Opcode == dns.OpcodeUpdate {
|
||||||
|
log.Debug("Refusing DNS Dynamic update request")
|
||||||
|
m.MsgHdr.Rcode = dns.RcodeRefused
|
||||||
}
|
}
|
||||||
|
|
||||||
w.WriteMsg(m)
|
w.WriteMsg(m)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user