Skip to content

PublicSuffix Class ​

Definition ​

Resolves public suffixes and registrable domains using the Public Suffix List.

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

Fields ​

NameDescription
DefaultListSourceUrlDefault public suffix list source URL.

Properties ​

NameDescription
DataCommitGets the source commit identifier declared by the loaded list file.
DataVersionGets the source version identifier declared by the loaded list file.
RuleCountGets the number of rules currently loaded from the public suffix list.

Methods ​

NameDescription
string GetRegistrableDomain(Uri uri)Returns the registrable domain for a URI host, or when one cannot be determined.
string GetRegistrableDomain(string host)Returns the registrable domain for a hostname, or when one cannot be determined.
string GetSuffix(Uri uri)Returns the public suffix for a URI host, or when one cannot be determined.
string GetSuffix(string host)Returns the public suffix for a hostname, or when one cannot be determined.
PublicSuffixRefreshResult Refresh(string datContent)Reloads the public suffix list from public_suffix_list.dat content.
Task<PublicSuffixRefreshResult> RefreshFromSourceAsync(CancellationToken cancellationToken = null)Downloads and reloads the public suffix list from DefaultListSourceUrl.
Task<PublicSuffixRefreshResult> RefreshFromSourceAsync(string sourceUrl, CancellationToken cancellationToken = null)Downloads and reloads the public suffix list from the specified source URL.
bool TryGetRegistrableDomain(Uri uri, out string domain)Attempts to resolve the registrable domain for a URI host.
bool TryGetRegistrableDomain(string host, out string domain)Attempts to resolve the registrable domain for a hostname.
bool TryGetSuffix(Uri uri, out string suffix)Attempts to resolve the public suffix for a URI host.
bool TryGetSuffix(string host, out string suffix)Attempts to resolve the public suffix for a hostname.

Remarks ​

The embedded list is sourced from . Use Refresh to reload newer list content at runtime during development.