#whois

whois-rust

This is a WHOIS client library for Rust, inspired by https://github.com/hjr265/node-whois

10 stable releases

1.1.6 Dec 31, 2018
1.1.5 Dec 24, 2018
1.1.4 Nov 14, 2018
1.0.1 Oct 29, 2018

#7 in WebSocket

Download history 44/week @ 2018-11-23 19/week @ 2018-11-30 21/week @ 2018-12-07 7/week @ 2018-12-14 121/week @ 2018-12-21 17/week @ 2018-12-28 22/week @ 2019-01-04 6/week @ 2019-01-11 12/week @ 2019-01-18 2/week @ 2019-01-25 7/week @ 2019-02-01 7/week @ 2019-02-08 6/week @ 2019-02-15 3/week @ 2019-02-22 25/week @ 2019-03-01

122 downloads per month

MIT license

20KB
353 lines

WHOIS Rust

Build Status Build status

This is a WHOIS client library for Rust, inspired by https://github.com/hjr265/node-whois

Usage

You can make a servers.json file or copy one from https://github.com/hjr265/node-whois

This is a simple example of servers.json.

{
    "org": "whois.pir.org",
    "": "whois.ripe.net",
    "_": {
        "ip": {
            "host": "whois.arin.net",
            "query": "n + $addr\r\n"
        }
    }
}

Then, use the from_path (or from_string if your JSON data is in-memory) associated function to create a WhoIs instance.

extern crate whois_rust;

use whois_rust::WhoIs;

let whois = WhoIs::from_path("/path/to/servers.json").unwrap();

Use the lookup method and input a WhoIsLookupOptions instance to lookup a domain or an IP.

extern crate whois_rust;

use whois_rust::{WhoIs, WhoIsLookupOptions};

let whois = WhoIs::from_path("/path/to/servers.json").unwrap();

let result: String = whois.lookup(WhoIsLookupOptions::from_string("magiclen.org").unwrap()).unwrap();

Crates.io

https://crates.io/crates/whois-rust

Documentation

https://docs.rs/whois-rust

License

MIT

Dependencies

~4MB
~85K SLoC