core/dnsserver: add opt-in opcode admission (#8469)

Keep miekg/dns's default request policy unless a plugin explicitly registers an additional opcode. Aggregate the policy at the listener, then enforce it again after zone routing so mixed server blocks on one socket remain isolated.

Apply the same policy to UDP, TCP, and DNS-over-TLS while preserving TSIG verification and the one-question requirement.

Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
This commit is contained in:
houyuwushang
2026-08-26 16:41:28 +08:00
committed by GitHub
parent b8720090b5
commit 70b5d6b5be
7 changed files with 378 additions and 14 deletions

View File

@@ -55,6 +55,7 @@ func (s *ServerTLS) Serve(l net.Listener) error {
s.server[tcp] = &dns.Server{Listener: l,
Net: "tcp-tls",
TsigSecret: s.tsigSecret,
MsgAcceptFunc: s.msgAcceptFunc(),
MaxTCPQueries: s.MaxTCPQueries,
ReadTimeout: s.ReadTimeout,
WriteTimeout: s.WriteTimeout,