whois 1.0.0 copy "whois: ^1.0.0" to clipboard
whois: ^1.0.0 copied to clipboard

Lightweight and performant WHOIS client supporting hundreds of TLDs.

example/main.dart

import 'package:whois/whois.dart';

main() async {
  // The domain we want to query, and options for the whois server
  const domain = 'google.com';

  // Additional options to the query
  var options = const LookupOptions(
    // Set timeout to 10 seconds
    timeout: Duration(milliseconds: 10000),

    // Set the whois port, default is 43
    port: 43,
  );

  try {
    final whoisResponse = await Whois.lookup(domain, options);

    // print(whoisResponse);

    // A parsed key/value of the whois results
    final parsedResponse = Whois.formatLookup(whoisResponse);

    print(
        'The domain ${parsedResponse['Domain Name'].toLowerCase()} is registered with ${parsedResponse['Registrar']}');
    print('Domain is due to expire, ${parsedResponse['Registry Expiry Date']}');
    print(
        'For abuse please contact, ${parsedResponse['Registrar Abuse Contact Email']}');
  } catch (e) {
    print('Error: $e');
  }
}
1
likes
140
pub points
71%
popularity

Publisher

verified publisherxeost.com

Lightweight and performant WHOIS client supporting hundreds of TLDs.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

More

Packages that depend on whois