Registry / utility / publicsuffix

publicsuffix

JSON →
library2.3.0rscratesunverified

Extract root domain and suffix from a domain name using the Public Suffix List.

# Cargo.toml [dependencies] publicsuffix = "2.3.0"
INSTALL
IMPORT
SIG · PUBLICSUFFIX
P
publicsuffix
utilityrustv2.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

List
✓ use publicsuffix::List;

Fetch the Public Suffix List and extract the root domain from a URL.

use publicsuffix::List; fn main() -> Result<(), Box<dyn std::error::Error>> { let list = List::from_url("https://publicsuffix.org/list/public_suffix_list.dat")?; let domain = list.parse_domain("www.example.com")?; println!("Root domain: {}", domain.root()); Ok(()) }
Debug
Known issues
gotchaRequires network access to fetch the list; consider caching locally.
fix
Use List::from_path() with a pre-downloaded file or implement caching.
affects: >=2.0.0
Upgrade
Version history
2.3.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
publicsuffix — cargo add publicsuffix · libregistry