mirror of
https://github.com/joohoi/acme-dns.git
synced 2024-12-22 15:43:45 +07:00
Refuse dynamic updates properly (#124)
This commit is contained in:
parent
1d85bf75b0
commit
3bb130d055
@ -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
4
dns.go
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user