Nager.PublicSuffix
3.6.0
Prefix Reserved
dotnet add package Nager.PublicSuffix --version 3.6.0
NuGet\Install-Package Nager.PublicSuffix -Version 3.6.0
<PackageReference Include="Nager.PublicSuffix" Version="3.6.0" />
<PackageVersion Include="Nager.PublicSuffix" Version="3.6.0" />
<PackageReference Include="Nager.PublicSuffix" />
paket add Nager.PublicSuffix --version 3.6.0
#r "nuget: Nager.PublicSuffix, 3.6.0"
#:package Nager.PublicSuffix@3.6.0
#addin nuget:?package=Nager.PublicSuffix&version=3.6.0
#tool nuget:?package=Nager.PublicSuffix&version=3.6.0
Nager.PublicSuffix (PSL)
With so many different endings for domain names, it's hard to know if they're valid or not.
This project uses a list from publicsuffix.org, which keeps track of all the common endings like .com or .org.
It checks domain names against this list to see if they're okay.
Then, it splits the domain into three parts: the ending (like .com), the main part (like google), and any subparts (like www).
You can find the list on GitHub under publicsuffix list repository.
Use cases
- Cookie restriction for browsers
- Domain highlighting in the URL bar of browsers
- DMARC E-Mail Security
- Certificate requests (ACME)
- Determining Valid Wildcard Certificates
- Two-factor authentication (FIDO)
Code Examples
Analyze a Domain Using the Online Public Suffix List
Use a remote source to always work with the latest public suffix list
var ruleProvider = new SimpleHttpRuleProvider();
await ruleProvider.BuildAsync();
var domainParser = new DomainParser(ruleProvider);
var domainInfo = domainParser.Parse("sub.test.co.uk");
//domainInfo.Domain = "test";
//domainInfo.FullyQualifiedDomainName = "sub.test.co.uk";
//domainInfo.RegistrableDomain = "test.co.uk";
//domainInfo.Subdomain = "sub";
//domainInfo.TopLevelDomain = "co.uk";
Analyze a Domain Using a Local Public Suffix List
Use a local public suffix list file to analyze domains
var ruleProvider = new LocalFileRuleProvider("public_suffix_list.dat");
await ruleProvider.BuildAsync();
var domainParser = new DomainParser(ruleProvider);
var domainInfo = domainParser.Parse("sub.test.co.uk");
//domainInfo.Domain = "test";
//domainInfo.FullyQualifiedDomainName = "sub.test.co.uk";
//domainInfo.RegistrableDomain = "test.co.uk";
//domainInfo.Subdomain = "sub";
//domainInfo.TopLevelDomain = "co.uk";
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
-
.NETStandard 2.1
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
-
net8.0
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.8)
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.8)
NuGet packages (10)
Showing the top 5 NuGet packages that depend on Nager.PublicSuffix:
| Package | Downloads |
|---|---|
|
Newguys.Sport
Package Description |
|
|
SharpPulsar
SharpPulsar is Apache Pulsar Client built using Akka.net |
|
|
Rsk.AspNetCore.Fido
Allows your ASP.NET Core .NET 8.0 or .NET 9.0 website to act as a FIDO2 Relying Party. Certified by the FIDO Alliance. To purchase a license or get a demo license, contact sales@identityserver.com. |
|
|
AnimeDl
AnimeDl scrapes animes from sites for streaming or downloading. |
|
|
Intech.Core
Package Description |
GitHub repositories (5)
Showing the top 5 popular GitHub repositories that depend on Nager.PublicSuffix:
| Repository | Stars |
|---|---|
|
win-acme/win-acme
A simple ACME client for Windows (for use with Let's Encrypt et al.)
|
|
|
Flangvik/TeamFiltration
TeamFiltration is a cross-platform framework for enumerating, spraying, exfiltrating, and backdooring O365 AAD accounts
|
|
|
simple-acme/simple-acme
A simple cross platform ACME client (for use with Let's Encrypt et al.)
|
|
|
Stratus-Security/Subdominator
The Internets #1 Subdomain Takeover Tool
|
|
|
SphereNetwork/SphereSSL
Web-powered SSL certificate manager with DNS integration, auto-renewals, and cert tracking. It's like if Certbot and ZeroSSL had a baby. Certbot but more friendly, smarter, and with a dashboard.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 3.6.0 | 13,658 | 9/8/2025 |
| 3.5.1 | 865 | 9/4/2025 |
| 3.5.0 | 112,418 | 2/25/2025 |
| 3.4.0 | 288,176 | 11/28/2024 |
| 3.3.0 | 308,235 | 5/10/2024 |
| 3.2.0 | 24,842 | 4/8/2024 |
| 3.1.0 | 35,931 | 3/24/2024 |
| 3.0.1 | 11,295 | 2/20/2024 |
| 3.0.0 | 5,083 | 2/15/2024 |
| 2.4.0 | 1,656,559 | 5/31/2022 |
| 2.3.0 | 284,258 | 2/18/2022 |
| 2.2.2 | 773,722 | 2/9/2021 |
| 2.0.3 | 92,263 | 12/30/2020 |
| 1.5.1 | 651,697 | 2/10/2020 |
| 1.5.0 | 78,537 | 10/1/2019 |
| 1.3.1 | 80,927 | 6/28/2019 |
| 1.3.0 | 143,901 | 11/1/2018 |
| 1.2.2 | 46,714 | 6/30/2018 |
| 1.2.0 | 13,500 | 3/12/2018 |
| 1.1.1 | 2,796 | 3/7/2018 |
| 1.1.0 | 12,957 | 9/27/2017 |
| 1.0.4 | 33,335 | 6/17/2017 |
| 1.0.3 | 3,816 | 3/12/2017 |
| 1.0.2 | 3,575 | 12/2/2016 |
| 1.0.0 | 5,522 | 10/27/2016 |