#tokio #dns #async-dns #async #dns-resolution #name #future

tokio-dns-unofficial

Unofficial extension to tokio to provide asynchronous DNS resolution

7 unstable releases (3 breaking)

Uses old Rust 2015

0.4.0 Aug 2, 2018
0.3.1 Jun 12, 2018
0.3.0 Mar 31, 2018
0.2.0 Jan 30, 2018
0.1.1 Dec 20, 2016

#17 in #async-dns

Download history 519/week @ 2024-07-29 429/week @ 2024-08-05 768/week @ 2024-08-12 531/week @ 2024-08-19 534/week @ 2024-08-26 515/week @ 2024-09-02 453/week @ 2024-09-09 435/week @ 2024-09-16 525/week @ 2024-09-23 450/week @ 2024-09-30 120/week @ 2024-10-07 406/week @ 2024-10-14 401/week @ 2024-10-21 475/week @ 2024-10-28 389/week @ 2024-11-04 229/week @ 2024-11-11

1,511 downloads per month
Used in 15 crates (3 directly)

Apache-2.0/MIT

18KB
351 lines

tokio-dns

Asynchronous name resolution utilities for the futures and tokio-core crates. Look at the crate-level documentation for more details.

BuildStatus

Documentation

This library has been packaged to crates.io. Note that its name on crates.io is tokio-dns-unofficial, but the crate's name is tokio_dns (when using extern crate ...).

Changelog

0.4.0

  • Added a ton of combinations of IpAdrr, SocketAddr, and port to the ToEndpoint trait.
  • Added new free functions to resolve a host/endpoint to a sequence of ip addresses or socket addresses, thanks @Fedcomp .
  • Small docs changes and new examples.

0.3.1

  • Fix a rustc regression, thanks @mehcode .

0.3.0

  • Update to the new tokio crate.
  • Change the API to look more like tokio's API.
  • New resolve free function to resolve a hostname asynchronously using the default resolver.

Demo

// Taken from examples/basic.rs
use tokio_dns::TcpStream;

// connect using the built-in resolver.
let conn = TcpStream::connect("rust-lang.org:80").and_then(|sock| {
    println!("conncted to {}", sock.peer_addr().unwrap());
    Ok(())
});

License

MIT or Apache

Dependencies

~3.5MB
~49K SLoC