fix: return NXDOMAIN for .local queries instead of SERVFAIL

.local is reserved for mDNS (RFC 6762) and cannot be resolved by
upstream DNS servers. Add it to is_special_use_domain() so queries
like _grpc_config.localhost.local get an immediate NXDOMAIN instead
of timing out and returning SERVFAIL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Razvan Dimescu
2026-03-28 19:15:00 +02:00
parent ebfc31d793
commit 861a7fb9c3

View File

@@ -366,7 +366,11 @@ fn is_special_use_domain(qname: &str) -> bool {
return true;
}
// NAT64 (RFC 8880)
qname == "ipv4only.arpa"
if qname == "ipv4only.arpa" {
return true;
}
// RFC 6762: .local is reserved for mDNS — never forward to upstream
qname == "local" || qname.ends_with(".local")
}
fn special_use_response(query: &DnsPacket, qname: &str, qtype: QueryType) -> DnsPacket {