c-ares-resolver 3.1.0

An asynchronous DNS resolver, backed by c-ares.
Documentation

c-ares-resolver

A more convenient API around c-ares, for asynchronous DNS requests.

The c-ares crate provides a safe wrapper around the underlying C library, but it's relatively hard work to use: the user needs to drive the polling of file descriptors according to c-ares demands, which likely involves writing something close to a full-blown event loop.

This crate does that hard work for you so that the presented API is much more straightforward.

Build Status Build status crates.io

Documentation

API documentation is here.

Examples

extern crate c_ares_resolver;
extern crate tokio_core;

fn main() {
    let resolver = c_ares_resolver::FutureResolver::new().unwrap();
    let query = resolver.query_a("google.com");
    let mut event_loop = tokio_core::reactor::Core::new().unwrap();
    let result = event_loop.run(query).unwrap();
    println!("{}", result);
}

Further example programs can be found here.

Contributing

Contributions are welcome. Please send pull requests!