#whois #parser #lookup

ezwhois-rs

A crate for querying WHOIS data and parsing this information, while providing a comfortable high-level API

5 releases

0.1.4 Feb 9, 2025
0.1.3 Feb 9, 2025
0.1.2 Feb 9, 2025
0.1.1 Feb 9, 2025
0.1.0 Feb 9, 2025

#974 in Parser implementations

Download history 295/week @ 2025-02-04 141/week @ 2025-02-11

436 downloads per month

Custom license

31KB
128 lines

ezwhois-rs

A crate for retrieving WHOIS data comfortably. It seperates the WHOIS information parser and querying part. By default the parser implementation is included. Disable default-futures for this crate if you would like to use a different parser.

Usage

#[tokio::test]
async fn test_client() {
    let client = Whois::new(WhoisOpt{
        whois_server: "whois.iana.org:43", 
        domain2lookup: "simpaix.net"
    });
    let res = client.query().await.expect("expected a response");

    let parser = parser::Parser::new();
    let info = parser.parse(res).unwrap();
    println!("creation date: {}\nexpire: {}", 
        info.creation_date.unwrap().format("%d/%m/%Y %H:%M"),
        info.registry_expirity_date.unwrap()
    ); // info.registry_domain_id , etc etc
}
/// running 1 test
/// test test_client ... ok
///
// successes:
///
// ---- test_client stdout ----
// creation date: 20/06/2023 12:13
// expire: 2025-06-20 12:13:22 UTC

Dependencies

~3.5–10MB
~91K SLoC