Skip to content

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

License

Notifications You must be signed in to change notification settings

hazzik/PublicSuffix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);