https://github.com/jedisct1/rust-dnsclient
A simple and secure DNS client crate for Rust.
https://github.com/jedisct1/rust-dnsclient
dns rust
Last synced: 10 months ago
JSON representation
A simple and secure DNS client crate for Rust.
- Host: GitHub
- URL: https://github.com/jedisct1/rust-dnsclient
- Owner: jedisct1
- License: isc
- Created: 2018-11-09T23:09:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-02T20:59:58.000Z (about 1 year ago)
- Last Synced: 2025-07-28T05:54:16.315Z (11 months ago)
- Topics: dns, rust
- Language: Rust
- Homepage:
- Size: 52.7 KB
- Stars: 37
- Watchers: 2
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A simple and secure DNS client for Rust
=======================================
[API documentation](https://docs.rs/dnsclient)
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 an asynchronous interface (`async::*`).
Cargo features:
- `async-smol`: use `smol` as an async backend
- `async-tokio`: use `tokio` as an async backend (default)