PublicSuffix - Highly optimized Domain Name parser using Mozilla's Public Suffix List (https://publicsuffix.org/)
Download the latest release from the NuGet repository
Install-Package Brandy.PublicSuffix
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);