Rsft.Net.DomainParser 1.3.240

There is a newer version of this package available.
See the version list below for details.
dotnet add package Rsft.Net.DomainParser --version 1.3.240
                    
NuGet\Install-Package Rsft.Net.DomainParser -Version 1.3.240
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rsft.Net.DomainParser" Version="1.3.240" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rsft.Net.DomainParser" Version="1.3.240" />
                    
Directory.Packages.props
<PackageReference Include="Rsft.Net.DomainParser" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rsft.Net.DomainParser --version 1.3.240
                    
#r "nuget: Rsft.Net.DomainParser, 1.3.240"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rsft.Net.DomainParser@1.3.240
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rsft.Net.DomainParser&version=1.3.240
                    
Install as a Cake Addin
#tool nuget:?package=Rsft.Net.DomainParser&version=1.3.240
                    
Install as a Cake Tool

Domain Parser

.NET domain parsing library.

Overview

Parsing domain names is not easy. For example, how does one extract Top Level Domain (TLD) data from the address 'me.com.br'? Is the TLD br, or is it com.br? The correct answer is com.br, but how can we know? The answer is that it is not possible to write simple rules in code to determine TLDs with any accuracy. Therefore, a list of all TLDs is maintained at PublicSuffix.

The solution to the problem of parsing domains is to maintain a list. The PublicSuffix project maintains such a project.

From PublicSuffix:

"Since there is no algorithmic method of finding the highest level at which a domain may be registered for a particular top-level domain (the policies differ with each registry), the only method is to create a list. This is the aim of the Public Suffix List."

The Rolosoft Domain Parser software parses domain names into TLD, Second Level Domain (SLD) and host using rules found at PublicSuffix.

Features and Benefits

  • Thread safe.
  • High performance by using aggressive caching and non-blocking async/await method calls internally.
  • Data redundancy. Uses online, external live data for up to date list. Automatic failover to local resource copy in remote data source is offline.
  • Async logging. Non blocking, async logging using SLAB.
  • Easily extensible. Need to pull the TLD data from somewhere else (e.g. Azure storage)? No problem, create your own implementation of the built in IReadOnlyRepository<TEntity,TKey> interface and pass this into the factory Create method.

Who Is This For?

This component is for anyone that needs reliable, accurate and fast domain name parsing.

Installation

From Nuget.

install-package Rsft.Net.DomainParser

Quickstart

Start parsing domains easily using the internal, default settings.

/*Create instance of domain parser*/
var domainParser = DomainParserFactory.Create();

/*Parse the domain name*/
var domainInfo = domainParser.Parse("h1.mydomain.com.br");

/*Output results*/
Console.WriteLine("TLD: {0}", domainInfo.Tld);
Console.WriteLine("Second Level Domain: {0}", domainInfo.Sld);
Console.WriteLine("Sub domain: {0}", domainInfo.Subdomain);

/*
* Output:
* TLD: com.br
* Second Level Domain: mydomain
* Sub domain: h1
*/

Extensibility

There are two extensibility options:

  • IReadOnlyRepository<TEntity, in TKey>. Use this to provide your own implementation of source for the TLD data. Useful if you would like to obtain data from other resource locations (e.g. Azure, SQL etc) other than PublicSuffix.
  • IConfiguration<Rsft.Net.DomainParser.Entities.Service.Configuration>. Use this to provide custom configuration options for the URL used to fetch data from PublicSuffix or to change the HTTP timeout associated with the fetch.

Both extensibility implementations can be supplied to the main factory "Create(..)" method. If none are supplied, internal default implementations are used.

Logging

High performance, Azure compatible exception and application logging is provided using SLAB.

Enable logging using standard SLAB listeners.

var ObservableEventListener listener1;
var ObservableEventListener listener2;

listener1 = new ObservableEventListener();
listener1.EnableEvents(ExceptionLoggingEventSource.Log, EventLevel.Error);

listener1.LogToConsole();

listener2 = new ObservableEventListener();
listener2.EnableEvents(ActivityLoggingEventSource.Log, EventLevel.Error, Keywords.All);

listener2.LogToConsole();

For full details of logging options see the "Rsft.Net.DomainParser.Diagnostics.EventSources" namespace in the source code.

Credits

Product 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 was computed.  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 was computed. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Rsft.Net.DomainParser:

Package Downloads
Utils.Web_Contextual

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.241 144 11/30/2026
1.3.240 99 11/29/2026
1.3.237 21,124 12/19/2025
1.3.235 648 12/9/2025
1.3.197 20,744 11/26/2024
1.3.195 55,695 10/25/2024
1.3.193 6,478 10/9/2024
1.3.191 948 9/27/2024
1.3.189 608 9/23/2024
1.3.187 1,756 9/7/2024
1.3.185 649 9/3/2024
1.3.183 976 8/21/2024
1.3.181 1,688 7/9/2024
1.3.179 418 7/7/2024
1.3.177 542 6/23/2024
1.3.175 975 5/25/2024
1.3.173 437 5/23/2024
1.3.171 7,039 4/28/2024
1.3.169 614 4/12/2024
1.3.167 2,639 2/16/2024
Loading failed

Split out core as lightweight implementation.