16 releases (breaking)

Uses new Rust 2021

0.13.0 Apr 28, 2022
0.12.0 Jan 18, 2022
0.11.1 Nov 20, 2021

#175 in Network programming

Download history 73/week @ 2022-01-29 69/week @ 2022-02-05 66/week @ 2022-02-12 81/week @ 2022-02-19 138/week @ 2022-02-26 539/week @ 2022-03-05 97/week @ 2022-03-12 122/week @ 2022-03-19 65/week @ 2022-03-26 74/week @ 2022-04-02 338/week @ 2022-04-09 361/week @ 2022-04-16 409/week @ 2022-04-23 175/week @ 2022-04-30 182/week @ 2022-05-07 344/week @ 2022-05-14

1,112 downloads per month
Used in ch4

MIT/Apache

295KB
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.

crates.io docs.rs

Notable Features

  • Minimal API
  • Asynchronous DNS clients for tokio, async-std and smol
  • 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.

Benchmarks

All benchmarks, performance measurements and comparison are maintained in a separate repository rsdns-benches.

Supported RFCs

Roadmap

The following is a short list of features planned for the near future.

Changelog

The changelog is maintained in CHANGELOG.md

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.

Dependencies

~0.8–8MB
~138K SLoC