A more convenient API around c-ares
, for asynchronous DNS requests.
API documentation is here.
```rust extern crate caresresolver; extern crate tokio_core;
fn main() { let resolver = caresresolver::FutureResolver::new().unwrap(); let query = resolver.querya("google.com"); let mut eventloop = tokiocore::reactor::Core::new().unwrap(); let result = eventloop.run(query).unwrap(); println!("{}", result); } ```
Further example programs can be found here.
To use c-ares-resolver
, add this to your Cargo.toml
:
toml
[dependencies]
c-ares-resolver = "*"
And add this to your crate root:
rust
extern crate c_ares_resolver;
Contributions are welcome. Please send pull requests!