Skip to main content

Crate whoizz

Crate whoizz 

Source
Expand description

whoizz — tiny RFC 3912 whois client with best-effort field extraction.

Supports both domain whois (via TLD registries) and IP whois (via the Regional Internet Registries — ARIN, RIPE, APNIC, LACNIC, AFRINIC). Both flows use the same IANA-referral mechanism: query whois.iana.org, read the refer: line, then query the referred server for the actual record.

§Domain lookup

let r = whoizz::lookup("rust-lang.org")?;
println!("registrar:   {:?}", r.registrar);
println!("created:     {:?}", r.created);
println!("expires:     {:?}", r.expires);
println!("nameservers: {:?}", r.nameservers);

§IP lookup

use std::net::IpAddr;
let ip: IpAddr = "8.8.8.8".parse().unwrap();
let r = whoizz::lookup_ip(ip)?;
println!("server: {}", r.server);  // e.g. "whois.arin.net"
println!("--- raw ---\n{}", r.raw);

See the crate README for limitations and details.

Structs§

WhoisResponse
Parsed result of a whois lookup.

Enums§

WhoisError
Errors returned by whois lookups.

Constants§

DEFAULT_TIMEOUT
Default connect/read/write timeout for whois queries.

Functions§

lookup
Look up whois information for a domain with the default timeout.
lookup_ip
Look up whois information for an IP address.
lookup_ip_with_timeout
Like lookup_ip with a caller-specified timeout.
lookup_with_timeout
Like lookup with a caller-specified timeout.