fix: return NXDOMAIN for .local queries instead of SERVFAIL (#18)
.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:
@@ -366,7 +366,11 @@ fn is_special_use_domain(qname: &str) -> bool {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// NAT64 (RFC 8880)
|
// 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 {
|
fn special_use_response(query: &DnsPacket, qname: &str, qtype: QueryType) -> DnsPacket {
|
||||||
|
|||||||
Reference in New Issue
Block a user