PublicSuffix - Highly optimized, very fast Domain Name parser using Mozilla's Public Suffix List (https://publicsuffix.org/)
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
PublicSuffix.Test
PublicSuffix
.gitignore
LICENSE
PublicSuffix.sln
README.md
build.bat

README.md

PublicSuffix

PublicSuffix - Highly optimized Domain Name parser using Mozilla's Public Suffix List (https://publicsuffix.org/)

Installation

Download the latest release from the NuGet repository

Install-Package Brandy.PublicSuffix

Examples

var parser = DomainParser.Default; // Loads rules from https://publicsuffix.org/list/effective_tld_names.dat
var domain = parser.Parse("xxx.www.takahama.aichi.jp");

Assert.IsTrue(domain.IsValid);
Assert.AreEqual("www.takahama.aichi.jp", domain.RegistrableDomain);
Assert.AreEqual("xxx", domain.Subdomain);
Assert.AreEqual("takahama.aichi.jp", domain.PublicSuffix);