Skip to content

WhoisService Class ​

Definition ​

Provides WHOIS lookups for domain names using embedded IANA TLD server mappings and live referral against DefaultIanaReferralServer.

  • Namespace: JASE.Network
  • Assembly: JASE.Network.dll

Fields ​

NameDescription
DefaultIanaReferralServerDefault IANA WHOIS referral server used to resolve TLD registry hosts.
DefaultTldListSourceUrlDefault IANA root-zone TLD list source URL.

Properties ​

NameDescription
RegistryGeneratedGets the UTC timestamp when the loaded registry file was generated.
ServerEntryCountGets the number of TLD entries currently loaded from the WHOIS server registry.
TldListVersionGets the IANA TLD list version declared by the loaded registry file.

Methods ​

NameDescription
bool IsWhoisTld(DomainProfile profile)Returns when the profile IANA root-zone TLD has an entry in the embedded WHOIS server registry.
bool IsWhoisTld(Uri uri)Returns when the URI host's IANA root-zone TLD has an entry in the embedded WHOIS server registry.
bool IsWhoisTld(string domain)Returns when the domain's IANA root-zone TLD has an entry in the embedded WHOIS server registry.
Task<WhoisQueryResult> QueryAsync(DomainProfile profile, CancellationToken cancellationToken = null)Performs a WHOIS query for a domain profile.
Task<WhoisQueryResult> QueryAsync(Uri uri, CancellationToken cancellationToken = null)Performs a WHOIS query for a URI host.
Task<WhoisQueryResult> QueryAsync(string domain, CancellationToken cancellationToken = null)Performs a WHOIS query for a hostname, domain name, or absolute URI.
WhoisRegistryRefreshResult Refresh(string json)Reloads the WHOIS server registry from JSON content.
Task<WhoisRegistryRefreshResult> RefreshFromSourceAsync(CancellationToken cancellationToken = null)Downloads the IANA TLD list and rebuilds the WHOIS server registry by querying DefaultIanaReferralServer for each TLD.
Task<WhoisRegistryRefreshResult> RefreshFromSourceAsync(string tldListSourceUrl, CancellationToken cancellationToken = null)Downloads a TLD list and rebuilds the WHOIS server registry by querying DefaultIanaReferralServer for each listed TLD.
Task<string> ResolveWhoisServerReferralAsync(string tld, CancellationToken cancellationToken = null)Resolves the authoritative registry WHOIS server for a TLD using a live IANA referral query.
bool TryGetWhoisServer(DomainProfile profile, out WhoisServerMatch match)Attempts to resolve the WHOIS server from a domain profile using the embedded registry only.
bool TryGetWhoisServer(Uri uri, out WhoisServerMatch match)Attempts to resolve the WHOIS server for a URI host using the embedded registry only.
bool TryGetWhoisServer(string domain, out WhoisServerMatch match)Attempts to resolve the WHOIS server for a domain using the embedded registry only.
Task<WhoisServerMatch> TryResolveWhoisServerAsync(DomainProfile profile, CancellationToken cancellationToken = null)Attempts to resolve the WHOIS server from a domain profile using the embedded registry, falling back to a live IANA referral query when the TLD is not embedded.
Task<WhoisServerMatch> TryResolveWhoisServerAsync(Uri uri, CancellationToken cancellationToken = null)Attempts to resolve the WHOIS server for a URI host using the embedded registry, falling back to a live IANA referral query when the TLD is not embedded.
Task<WhoisServerMatch> TryResolveWhoisServerAsync(string domain, CancellationToken cancellationToken = null)Attempts to resolve the WHOIS server for a domain using the embedded registry, falling back to a live IANA referral query when the TLD is not embedded.

Remarks ​

Unlike RDAP, IANA does not publish a single JSON bootstrap file for WHOIS servers. The embedded registry is built from IANA WHOIS referrals and can be refreshed using RefreshFromSourceAsync.

WHOIS response formats vary by registry. Expiration parsing is best-effort and may return when a registry redacts or omits expiry data.