20 releases

0.1.19 Mar 17, 2024
0.1.18 May 7, 2023
0.1.17 Dec 15, 2021
0.1.16 Oct 16, 2021
0.1.2 Nov 9, 2018

#124 in Unix APIs

Download history 119/week @ 2023-12-22 101/week @ 2023-12-29 85/week @ 2024-01-05 94/week @ 2024-01-12 74/week @ 2024-01-19 230/week @ 2024-01-26 160/week @ 2024-02-02 239/week @ 2024-02-09 575/week @ 2024-02-16 458/week @ 2024-02-23 412/week @ 2024-03-01 418/week @ 2024-03-08 911/week @ 2024-03-15 579/week @ 2024-03-22 157/week @ 2024-03-29 65/week @ 2024-04-05

1,811 downloads per month
Used in 9 crates (5 directly)

ISC license

42KB
1K SLoC

A simple and secure DNS client for Rust

API documentation

This is a DNS client crate. Some people may call that a stub resolver.

It can resolve IPv4 and IPv6 addresses. But unlike std::net::ToSocketAddrs, it directly contacts upstream servers, and doesn't depend on the system resolver. Which, in the worst case, could be systemd.

Instead, your application fully controls what upstream resolvers will be used.

It can also send raw queries, and return raw responses, retrying over multiple server candidates if necessary.

DNSClient carefully checks the consistency of every single packet it receives.

It will not let clients initiate zone transfers. It may prevent funky DNS implementations from crashing or being exploited when a malicious query or response is received.

It also transparently falls back to TCP when a truncated response is received.

Finally, its API couldn't be any simpler.

DNSClient comes with a synchronous interface (sync::*) as well as anasynchronous interface (async::*).

Cargo features:

  • async: use async-std as an async backend
  • async-tokio: use tokio as an async backend

Dependencies

~2–15MB
~161K SLoC