14 stable releases

✓ Uses Rust 2018 edition

1.1.10 Feb 27, 2020
1.1.9 Sep 17, 2019
1.1.8 Jul 29, 2019
1.1.7 Jun 24, 2019
1.0.1 Oct 29, 2018

#8 in WebSocket

Download history 26/week @ 2019-12-01 212/week @ 2019-12-08 1/week @ 2019-12-15 13/week @ 2019-12-22 1/week @ 2019-12-29 13/week @ 2020-01-12 27/week @ 2020-01-19 1/week @ 2020-01-26 13/week @ 2020-02-09 13/week @ 2020-02-16 70/week @ 2020-02-23 5/week @ 2020-03-01 29/week @ 2020-03-08 16/week @ 2020-03-15

118 downloads per month

MIT license

20KB
399 lines

WHOIS Rust

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
~108K SLoC