feat: log unsupported Opcodes
1 files changed, 8 insertions(+), 1 deletions(-) M internal/dns/handle.go
M internal/dns/handle.go => internal/dns/handle.go +8 -1
@@ 7,7 7,11 @@ package dns import "github.com/miekg/dns" import ( "log/slog" "github.com/miekg/dns" ) func handleDNSRequest(w dns.ResponseWriter, r *dns.Msg) { @@ m := new(dns.Msg) 17,6 21,9 @@ func handleDNSRequest(w dns.ResponseWriter, r *dns.Msg) { switch r.Opcode { case dns.OpcodeQuery: parseQuery(m, r) default: slog.Info("Unsupported Opcode", slog.String("type", dns.OpcodeToString[r.Opcode])) m.SetRcode(r, dns.RcodeNotImplemented) } w.WriteMsg(m)