Registry / networking / hickory-client

hickory-client

JSON →
library0.25.2rscratesunverified

A safe and secure DNS client library with DNSSEC support, based on Tokio and Futures.

# Cargo.toml [dependencies] hickory-client = "0.25.2"
INSTALL
IMPORT
SIG · HICKORY-CLIENT
H
hickory-client
networkingrustv0.25.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AsyncClient
use hickory_client::client::AsyncClient;

Creates an async DNS client and connects to a resolver.

use hickory_client::client::AsyncClient; use hickory_client::rr::DNSClass; use std::net::SocketAddr; use tokio::net::UdpSocket; #[tokio::main] async fn main() { let addr: SocketAddr = "8.8.8.8:53".parse().unwrap(); let socket = UdpSocket::bind("0.0.0.0:0").await.unwrap(); let (client, bg) = AsyncClient::new(socket, addr, None).await.unwrap(); tokio::spawn(bg); println!("DNS client created"); }
Debug
Known issues
gotchaRequires Tokio runtime for async operations.
fix
Add tokio as a dependency and use #[tokio::main] or similar runtime.
affects: >=0.25.0
gotchaDNSSEC validation may require additional feature flags.
fix
Enable the 'dnssec' feature in Cargo.toml: hickory-client = { version = "0.25", features = ["dnssec"] }
affects: >=0.25.0
Upgrade
Version history
0.25.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
hickory-client — cargo add hickory-client · libregistry