Fix DNS domain name case preservation and DNS 0x20 encoding issues.
Fixed DNS 0x20 encoding bug in worker threads and removed automatic lowercasing in DNS buffer parsing to preserve case from authoritative sources. Implemented case-insensitive lookups for cache and blockchain while ensuring restoration of the original client query case in all response paths instead of returning randomized DNS 0x20 case from upstream servers.
This commit is contained in:
@@ -230,9 +230,11 @@ impl BlockchainFilter {
|
||||
|
||||
impl DnsFilter for BlockchainFilter {
|
||||
fn lookup(&self, qname: &str, qtype: QueryType, recursive: bool) -> Option<DnsPacket> {
|
||||
// Lowercase for case-insensitive lookup (blockchain stores domains as lowercase)
|
||||
let qname_lower = qname.to_lowercase();
|
||||
let top_domain;
|
||||
let subdomain;
|
||||
let parts: Vec<&str> = qname.rsplitn(3, '.').collect();
|
||||
let parts: Vec<&str> = qname_lower.rsplitn(3, '.').collect();
|
||||
match parts.len() {
|
||||
1 => {
|
||||
let mut packet = DnsPacket::new();
|
||||
|
||||
Reference in New Issue
Block a user