Expand description
Agnostic DNS
§Introduction
agnostic-dns provides runtime-agnostic DNS resolution built on hickory-dns. It supports multiple transport protocols (UDP, TCP, DoT, DoH, DoQ, DoH3) and DNSSEC validation - all working seamlessly across tokio, and smol runtimes.
§Key Features
- Multiple Transport Protocols:
- DNS over UDP/TCP (standard)
- DNS over TLS (DoT)
- DNS over HTTPS (DoH)
- DNS over QUIC (DoQ)
- DNS over HTTP/3 (DoH3)
- DNSSEC Support: Validate DNS responses with OpenSSL or ring
- Runtime Agnostic: Works with tokio, and smol
- Flexible Configuration: Use system settings or custom resolvers
- Comprehensive: Built on the mature hickory-dns library
§Supported Runtimes
- tokio - Enable with
features = ["tokio"] - smol - Enable with
features = ["smol"]
§Installation
[dependencies]
agnostic-dns = "0.3"-
tokioagnostic-dns = { version = "0.3", features = ["tokio"] } -
smolagnostic-dns = { version = "0.3", features = ["smol"] }
§Feature Matrix
| Feature | Description | Enable With |
|---|---|---|
| Core | ||
dns | Basic DNS resolution | Default |
| Runtimes | ||
tokio | Tokio runtime support | features = ["tokio"] |
smol | Smol runtime support | features = ["smol"] |
| Transport Protocols | ||
dns-over-rustls | DNS over TLS with rustls | features = ["dns-over-rustls"] |
dns-over-openssl | DNS over TLS with OpenSSL | features = ["dns-over-openssl"] |
dns-over-native-tls | DNS over TLS with native-tls | features = ["dns-over-native-tls"] |
dns-over-https-rustls | DNS over HTTPS with rustls | features = ["dns-over-https-rustls"] |
dns-over-quic | DNS over QUIC (RFC 9250) | features = ["dns-over-quic"] |
dns-over-h3 | DNS over HTTP/3 | features = ["dns-over-h3"] |
| Certificates | ||
dns-webpki-roots | Use webpki root certificates | features = ["dns-webpki-roots"] |
dns-native-certs | Use OS native certificates | features = ["dns-native-certs"] |
| DNSSEC | ||
dnssec | Basic DNSSEC validation | features = ["dnssec"] |
dnssec-openssl | DNSSEC with OpenSSL crypto | features = ["dnssec-openssl"] |
dnssec-ring | DNSSEC with ring crypto | features = ["dnssec-ring"] |
| Other | ||
tracing | Distributed tracing support | features = ["tracing"] |
§License
agnostic-dns is under the terms of both the MIT license and the
Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.
Copyright (c) 2025 Al Liu.
Re-exports§
pub use agnostic_net as net;
Structs§
- Agnostic
Time - DNS time
- Async
Connection Provider - Create
DnsHandlewith the help ofAsyncRuntimeProvider. - Async
DnsUdp - DNS udp
- Async
Runtime Provider - Defines which async runtime that handles IO and timers.
- Async
Spawn - Async spawner
- Name
Server Config - Configuration for the NameServer
- Name
Server Config Group - A set of name_servers to associate with a
ResolverConfig. - Resolver
Config - Configuration for the upstream nameservers to use for resolution
- Resolver
Opts - Configuration for the Resolver
- Timer
- Timer implementation for the dns.
Enums§
- Lookup
IpStrategy - The lookup ip strategy
- Protocol
- The protocol on which a NameServer should be communicated with
- Server
Ordering Strategy - The strategy for establishing the query order of name servers in a pool.
Constants§
- CLOUDFLARE_
IPS - IP addresses for Cloudflare’s 1.1.1.1 DNS service
- GOOGLE_
IPS - IP addresses for Google Public DNS
- QUAD9_
IPS - IP address for the Quad9 DNS service
Functions§
- parse_
resolv_ conf Unix - read_
resolv_ conf Unix - Read the DNS configuration from a file.
- read_
system_ conf
Type Aliases§
- Dns
- Agnostic aysnc DNS resolver