Skip to content

Commit

Permalink
Move to hickory-dns/client
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Oct 29, 2023
1 parent 5354154 commit 471cf0c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ path = "src/main.rs"

[dependencies]
rayon = "1.7.0"
trust-dns-client = { version = "0.22.0", default-features = false }
hickory-client = { version = "0.24.0", default-features = false }
rustdns = "0.4.0"
weighted-rs = "0.1.3"
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use trust_dns_client::client::{ Client, SyncClient };
use trust_dns_client::tcp::TcpClientConnection;
use hickory_client::client::{ Client, SyncClient };
use hickory_client::tcp::TcpClientConnection;
use std::str::FromStr;
use std::net::IpAddr;
use trust_dns_client::op::DnsResponse;
use trust_dns_client::rr::{ DNSClass, Name, RData, Record, RecordType };
use hickory_client::op::DnsResponse;
use hickory_client::rr::{ DNSClass, Name, RData, Record, RecordType };
use rustdns::util::reverse;
use rayon::prelude::*;
use std::fs::read_to_string;
Expand Down Expand Up @@ -79,7 +79,7 @@ fn ptr_resolve(
return PtrResult {
query_addr: to_resolve.address,
query: name,
result: Some(res.clone()),
result: Some(res.to_lowercase()),
error: None,
};
}
Expand All @@ -88,7 +88,7 @@ fn ptr_resolve(
// 75.7.246.87.in-addr.arpa. 3600 IN CNAME 75.0-255.7.246.87.in-addr.arpa.
// 75.0-255.7.246.87.in-addr.arpa. 86400 IN PTR bulbank.linkbg.com.
Some(RData::CNAME(res)) => {
return ptr_resolve(res.clone(), to_resolve, client);
return ptr_resolve(res.to_lowercase(), to_resolve, client);
}
Some(res) => {
eprintln!("Unexpected result ({:?}) for ({}) from: {}", res, name, to_resolve.server);
Expand Down

0 comments on commit 471cf0c

Please sign in to comment.