23 releases (breaking)
0.19.0 | Aug 30, 2024 |
---|---|
0.18.0 | Jul 12, 2024 |
0.17.0 | Jan 19, 2024 |
0.16.0 | Oct 21, 2023 |
0.11.1 | Nov 20, 2021 |
#933 in Network programming
573 downloads per month
Used in 2 crates
325KB
6.5K
SLoC
rsdns - DNS Client Library
rsdns is a Rust library for interacting with DNS servers.
Its main goal is to query the Domain Name System and return the results in easily consumable Rust types.
rsdns strives to be simple and fast. To be simple rsdns keeps a minimal API. To be fast rsdns aims to allow DNS message parsing with minimal overhead.
There are crates which implement asynchronous DNS clients, but are built for a single async runtime. This somewhat blocks usage of such client in an application built around another runtime. rsdns closes this gap and genuinely supports three different async runtimes. Moreover, rsdns has an independent synchronous client as well.
Notable Features
- Minimal API
- Asynchronous DNS clients for
tokio
,async-std
andsmol
- Blocking client implemented with
std::net
- Zero memory allocations when parsing records with no variable size fields
- Sockets can be bound to network interfaces by name (available on operating
systems with
SO_BINDTODEVICE
support) - Minimal set of dependencies
ch4
rsdns comes with a small command-line tool ch4. ch4 uses rsdns to query the Domain Name System, and shows the results in a zone-file format. It can be used as a simple substitute for dig, especially on platforms where dig is not originally supported.
Supported RFCs
- RFC 1035 - the foundation of DNS protocol:
A
,NS
,TXT
,CNAME
,SOA
,MX
,PTR
,ANY
etc. - RFC 1101, RFC 1123 - allow leading digits in domain name labels
- RFC 2181 - RRSet definition and TTL handling
- RFC 2671, RFC 6891 - EDNS0
- RFC 3596 -
AAAA
- RFC 7766 - DNS Transport over TCP, TCP message length field handling
Roadmap
The next planned features are:
Changelog
The changelog is maintained in CHANGELOG.md
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
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.
Dependencies
~0.9–13MB
~155K SLoC