#dns #client

dnsclient

A small, simple and secure DNS client library

18 releases

0.1.17 Dec 15, 2021
0.1.16 Oct 16, 2021
0.1.15 Aug 26, 2021
0.1.9 Dec 21, 2020
0.1.2 Nov 9, 2018

#77 in Unix APIs

Download history 19/week @ 2021-10-01 51/week @ 2021-10-08 39/week @ 2021-10-15 182/week @ 2021-10-22 71/week @ 2021-10-29 195/week @ 2021-11-05 52/week @ 2021-11-12 74/week @ 2021-11-19 62/week @ 2021-11-26 104/week @ 2021-12-03 84/week @ 2021-12-10 45/week @ 2021-12-17 41/week @ 2021-12-24 74/week @ 2021-12-31 52/week @ 2022-01-07 55/week @ 2022-01-14

222 downloads per month
Used in 7 crates (4 directly)

ISC license

41KB
996 lines

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

~1.7–4.5MB
~83K SLoC

?>a