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 ring or aws-lc-rs
- 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.6"-
tokioagnostic-dns = { version = "0.6", features = ["tokio"] } -
smolagnostic-dns = { version = "0.6", features = ["smol"] }
§Feature Matrix
| Feature | Description | Enable With |
|---|---|---|
| Runtimes | ||
tokio | Tokio runtime support | features = ["tokio"] |
smol | Smol runtime support | features = ["smol"] |
| Transport Protocols | ||
tls-ring | DNS over TLS (ring crypto) | features = ["tls-ring"] |
tls-aws-lc-rs | DNS over TLS (aws-lc-rs crypto) | features = ["tls-aws-lc-rs"] |
https-ring | DNS over HTTPS (ring crypto) | features = ["https-ring"] |
https-aws-lc-rs | DNS over HTTPS (aws-lc-rs crypto) | features = ["https-aws-lc-rs"] |
quic-ring | DNS over QUIC (ring crypto) | features = ["quic-ring"] |
quic-aws-lc-rs | DNS over QUIC (aws-lc-rs crypto) | features = ["quic-aws-lc-rs"] |
h3-ring | DNS over HTTP/3 (ring crypto) | features = ["h3-ring"] |
h3-aws-lc-rs | DNS over HTTP/3 (aws-lc-rs crypto) | features = ["h3-aws-lc-rs"] |
| Certificates | ||
webpki-roots | Use webpki root certificates | features = ["webpki-roots"] |
rustls-platform-verifier | Use platform certificate verifier | features = ["rustls-platform-verifier"] |
| DNSSEC | ||
dnssec-ring | DNSSEC with ring crypto | features = ["dnssec-ring"] |
dnssec-aws-lc-rs | DNSSEC with aws-lc-rs crypto | features = ["dnssec-aws-lc-rs"] |
| 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
DnsUdp - DNS udp
- Async
Runtime Provider - Defines which async runtime that handles IO and timers.
- Async
Spawn - Async spawner
- Connection
Config - Configuration for a connection to a nameserver
- Name
Server Config - Configuration for the NameServer
- Opportunistic
Encryption Config - Configuration parameters for opportunistic encryption.
- Opportunistic
Encryption Persistence - Configuration for persistence of opportunistic encryption probe state.
- Resolver
Config - Configuration for the upstream nameservers to use for resolution
- Resolver
Opts - Configuration for the Resolver
- Server
Group - A group of DNS servers.
- Timer
- Timer implementation for the dns.
Enums§
- Lookup
IpStrategy - The lookup ip strategy
- Opportunistic
Encryption - Configuration for enabling RFC 9539 opportunistic encryption.
- Protocol
Config - Protocol configuration
- Resolve
Hosts - Whether the system hosts file should be respected by the resolver.
- Server
Ordering Strategy - The strategy for establishing the query order of name servers in a pool.
Constants§
- CLOUDFLARE
- Cloudflare’s 1.1.1.1 DNS service configuration.
- Google Public DNS configuration.
- QUAD9
- The Quad9 DNS service configuration.
Functions§
- parse_
resolv_ conf Unix and non-Android and non-Apple - read_
resolv_ conf Unix and non-Android and non-Apple - Read the DNS configuration from a file.
- read_
system_ conf Unix or Windows
Type Aliases§
- Async
Connection Provider - Creates DNS connections with the help of
AsyncRuntimeProvider. - Dns
- Agnostic async DNS resolver