DomainTwistex.Utils.Whois (domaintwistex v0.9.0)

WHOIS and RDAP client for domain information lookup.

This module implements RDAP-first lookup with WHOIS fallback, using IANA RDAP bootstrap discovery and comprehensive TLD mappings.

WHOIS Server Data

WHOIS server mappings are sourced from IANA via the iana-whois-conf project, which scrapes https://www.iana.org/domains/root/db/{tld}.html pages.

To update the WHOIS server list, run:

mix update_whois_servers

Summary

Functions

Checks if a domain is registered.

Performs a WHOIS/RDAP lookup for the given domain.

Functions

is_registered?(domain)

Checks if a domain is registered.

Returns {:ok, true} if registered, {:ok, false} if not, {:error, reason} on failure.

lookup(domain)

Performs a WHOIS/RDAP lookup for the given domain.

This function tries RDAP first using IANA bootstrap registry, then falls back to traditional WHOIS if RDAP is not available.

Parameters

  • domain - String representing the domain to lookup

Returns

or {:error, reason} where map contains:

* :domain - The domain that was looked up
* :source - Either "rdap" or "whois"
* :raw_data - Raw response text
* :registrar - Domain registrar name (optional)
* :creation_date - Domain creation date (optional)
* :expiration_date - Domain expiration date (optional)
* :updated_date - Last update date (optional)
* :status - List of domain status codes (optional)
* :nameservers - List of nameservers (optional)
* :registrant - Registrant contact info map (optional)
* :admin_contact - Admin contact info map (optional)
* :tech_contact - Technical contact info map (optional)
* :abuse_contact - Abuse contact info map (optional)