Skip to content

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

License

Notifications You must be signed in to change notification settings

Z3NTL3/ezwhois-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages