From e1d0df33d5aeb2ddac6b9c16eae81cb963205289 Mon Sep 17 00:00:00 2001 From: Revertron Date: Fri, 2 Apr 2021 03:24:53 +0200 Subject: [PATCH] Fixed resolve of CNAME records. --- src/blockchain/filter.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blockchain/filter.rs b/src/blockchain/filter.rs index 0fdb5d7..f9ad94f 100644 --- a/src/blockchain/filter.rs +++ b/src/blockchain/filter.rs @@ -60,8 +60,9 @@ impl DnsFilter for BlockchainFilter { Ok(data) => { data } }; let mut answers: Vec = Vec::new(); + let a_record = qtype == QueryType::A || qtype == QueryType::AAAA; for mut record in data.records.iter_mut() { - if record.get_querytype() == qtype { + if record.get_querytype() == qtype || (a_record && record.get_querytype() == QueryType::CNAME) { match &mut record { DnsRecord::A { domain, .. } | DnsRecord::AAAA { domain, .. }