A Rust based DNS client, server, and resolver
Find a file
Jonathan Davies d8dea5a029 resolver: use options.connect_timeout for per-connection timeout
When top-ranked upstream servers are unreachable (SYN-drop), the pool
deadline and per-connection timeout were both set to `options.timeout`
(default 5s). This meant the first batch of failing servers consumed
the entire budget, preventing fallthrough to working servers — causing
indefinite SERVFAIL until the process was restarted.

All protocol connection paths (TCP, TLS, HTTPS, QUIC, H3) now pull the
per-connection timeout from `options.connect_timeout` (default 2s),
leaving enough deadline budget for the pool to try remaining servers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-24 08:03:00 +00:00
.cargo Fix #1835 RUSTSEC-2021-0145 Update clap to 4.0.29. 2022-12-05 05:49:49 -08:00
.github ci: run workflows for pull requests against any branch 2026-04-17 16:20:28 +00:00
audit Add audit report 2025-02-27 14:41:09 +00:00
bin bin: add support for jemalloc + profiling 2026-04-14 12:56:22 +00:00
conformance Add tests combining NSEC and NSEC3 via CNAME chain 2026-04-22 15:38:55 +00:00
crates resolver: use options.connect_timeout for per-connection timeout 2026-04-24 08:03:00 +00:00
fuzz Bump version to 0.26.0 2026-04-16 07:38:47 +00:00
scripts don't assume bash location for cert gen scripts 2025-09-25 21:27:28 +00:00
tests server: add configurable TCP response buffer size 2026-04-08 20:12:14 +00:00
util proto: drop extension trait in favor of inherent methods 2026-04-04 19:46:15 +00:00
.codecov.yml coverage range to 60..80 2023-06-11 09:17:27 -07:00
.gitignore Move coverage reports to separate output directory 2024-11-22 05:57:27 +00:00
.markdownlint.json cleanup Name and deprecate some interfaces 2017-07-30 12:53:02 -04:00
.rustfmt.toml Switch to 2024 style 2025-02-22 17:29:52 +00:00
ARCHITECTURE.md Rename variables and functions, update text 2025-09-02 14:08:37 +00:00
Cargo.lock Update rustls-webpki to 0.103.13 2026-04-22 15:29:20 +00:00
Cargo.toml Bump version to 0.26.0 2026-04-16 07:38:47 +00:00
CHANGELOG.md Remove CHANGELOG.md in favor of GitHub Releases 2025-03-18 20:24:50 +00:00
CODE_OF_CONDUCT.md Fix some links to HTTPS 2021-07-12 23:16:13 -04:00
CONTRIBUTING.md Remove CHANGELOG.md in favor of GitHub Releases 2025-03-18 20:24:50 +00:00
copyright.txt Prepare 0.24 release with branding change to Hickory DNS (#2054) 2023-10-13 18:39:28 -07:00
justfile Cargo: bump MSRV from 1.83 to 1.88 2026-02-06 20:56:54 +00:00
LICENSE-APACHE Prepare 0.24 release with branding change to Hickory DNS (#2054) 2023-10-13 18:39:28 -07:00
LICENSE-MIT Prepare 0.24 release with branding change to Hickory DNS (#2054) 2023-10-13 18:39:28 -07:00
logo.png update logo to better for Github 2023-10-14 09:42:34 -04:00
OLD-CHANGELOG.md Remove CHANGELOG.md in favor of GitHub Releases 2025-03-18 20:24:50 +00:00
README.md Include Docker usage section in README 2026-02-11 08:41:20 +00:00
SECURITY.md clarify supported versions, disclosure process, lack of bug bounty 2025-03-04 11:24:11 +00:00

Build Status codecov License: MIT License: Apache 2.0 Discord

Hickory DNS

Hickory DNS

A Rust based DNS client, server, and resolver, built to be safe and secure from the ground up.

This repo consists of multiple crates:

Library Description
Hickory DNS Provides the hickory-dns binary for running a DNS server.
Proto hickory-proto Low-level DNS library, including message encoding/decoding and DNS transports.
Client hickory-client Used for sending query, update, and notify messages directly to a DNS server.
Server hickory-server Used to build DNS servers. The hickory-dns binary makes use of this library.
Resolver hickory-resolver Utilizes the client library to perform DNS resolution. Can be used in place of the standard OS resolution facilities.
Recursor hickory-recursor Performs recursive DNS resolution, looking up records from their authoritative name servers.

NOTICE This project was rebranded from Trust-DNS to Hickory DNS and has been moved to the https://github.com/hickory-dns/hickory-dns organization and repo.

Goals

  • Build a safe and secure DNS server and client with modern features.
  • No panics, all code is guarded
  • Use only safe Rust, and avoid all panics with proper Error handling
  • Use only stable Rust
  • Protect against DDOS attacks (to a degree)
  • Support options for Global Load Balancing functions
  • Make it dead simple to operate

Cryptography provider

The hickory-dns application and lower-level library crates support choosing between two cryptography providers for protocols that require cryptography (DNSSEC, DNS-over-TLS, etc):

  1. aws-lc-rs
  2. ring

Feature flags that require cryptography are suffixed by the choice of provider. For example, for DNS-over-TLS the feature is offered as tls-aws-lc-rs or tls-ring depending on whether you wish to use aws-lc-rs or ring.

Status

DNSSEC status

The current root key is bundled into the system, and used by default. This gives validation of DNSKEY and DS records back to the root. NSEC and NSEC3 are implemented.

Zones will be automatically resigned on any record updates via dynamic DNS. To enable DNSSEC, enable the dnssec-ring feature.

Offline signing of records/zones is not presently supported.

RFCs implemented

Basic operations

Update operations

Secure DNS operations

  • RFC 2931: SIG(0)
  • RFC 3007: Secure Dynamic Update
  • RFC 4034: DNSSEC Resource Records
  • RFC 4035: Protocol Modifications for DNSSEC
  • RFC 4509: SHA-256 in DNSSEC Delegation Signer
  • RFC 5155: DNSSEC Hashed Authenticated Denial of Existence
  • RFC 5702: SHA-2 Algorithms with RSA in DNSKEY and RRSIG for DNSSEC
  • RFC 6844: DNS Certification Authority Authorization (CAA) Resource Record
  • RFC 6698: The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA
  • RFC 6840: Clarifications and Implementation Notes for DNSSEC
  • RFC 6844: DNS Certification Authority Authorization Resource Record
  • RFC 6944: DNSKEY Algorithm Implementation Status
  • RFC 6975: Signaling Cryptographic Algorithm Understanding
  • RFC 7858: DNS over TLS (feature: tls-aws-lc-rs/tls-ring)
  • RFC 8162: Using Secure DNS to Associate Certificates with Domain Names for S/MIME
  • RFC 8484: DNS over HTTPS, DoH (feature: https-aws-lc-rs/https-ring)

RFCs in progress or not yet implemented

Basic operations

  • RFC 2317: Classless IN-ADDR.ARPA delegation

Update operations

Secure DNS operations

Testing

Hickory DNS uses just for build workflow management. While running cargo test at the project root will work, this is not exhaustive. Install just with cargo install just. A few of the just recipes require cargo-workspaces to be installed, a plugin to optimize the workflow around cargo workspaces. Install the plugin with cargo install cargo-workspaces.

  • Default tests

    These are good for running on local systems. They will create sockets for local tests, but will not attempt to access remote systems. Tests can also be run from the crate directory, i.e. client or server and cargo test

just default
  • Default feature tests

    Hickory DNS has many features, to quickly test with them or without, there are three targets supported, default, no-default-features, all-features:

just all-features
  • Individual feature tests

    Hickory DNS has many features, each individual feature can be tested independently. See individual crates for all their features. Each feature can be tested with itself as the task target for just:

just tls-aws-lc-rs
  • Benchmarks

    Waiting on benchmarks to stabilize in mainline Rust.

Building

  • Production build, from the hickory-dns base dir, to get all features, just pass the --all-features flag.
cargo build --release -p hickory-dns

Using the hickory-resolver CLI

Available in 0.20

cargo install --bin resolve hickory-util

Or from source, in the hickory-dns directory

cargo install --bin resolve --path util

example:

$ resolve www.example.com.
Querying for www.example.com. A from udp:8.8.8.8:53, tcp:8.8.8.8:53, udp:8.8.4.4:53, tcp:8.8.4.4:53, udp:[2001:4860:4860::8888]:53, tcp:[2001:4860:4860::8888]:53, udp:[2001:4860:4860::8844]:53, tcp:[2001:4860:4860::8844]:53
Success for query name: www.example.com. type: A class: IN
        www.example.com. 21063 IN A 93.184.215.14

Usage with Docker

A Docker image with a pre-compiled version of hickory-dns is availalbe at https://github.com/hickory-dns/docker.

FAQ

  • Why are you building another DNS server?

    To offer a DNS server written in a memory-safe language.

    Using Rust semantics it should be possible to develop a high performance and safe DNS Server that is more resilient to attacks.

  • What is the MSRV (minimum stable Rust version) policy?

    Hickory DNS will work to support backward compatibility with three Rust versions.

    For example, if 1.50 is the current release, then the MSRV will be 1.47. The version is only increased as necessary, so it's possible that the MSRV is older than this policy states. Additionally, the MSRV is only supported for the no-default-features build due to it being an intractable issue of trying to enforce this policy on dependencies.

Community

For live discussions beyond this repository, please see this Discord.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.