Table of Contents

Class DomainUtils

Namespace
VpnHood.Core.Filtering.Abstractions
Assembly
VpnHood.Core.Filtering.Abstractions.dll

Provides the form of domain names that every domain filter and the domain-list database builder share, so that their entries and the names asked for match.

public static class DomainUtils
Inheritance
DomainUtils
Inherited Members

Methods

InvertDomain(string)

Reverses the order of a domain name's labels: www.example.com becomes com.example.www, a form in which a domain is an ordinal prefix of its subdomains, ending at a dot.

public static string InvertDomain(string domain)

Parameters

domain string

The name, as NormalizeDomain(string?) gives it.

Returns

string

The name with its labels reversed.

NormalizeDomain(string?)

Normalizes a domain name: trimmed, in lower case, and without a leading *., as an entry matches its subdomains anyway.

public static string NormalizeDomain(string? domain)

Parameters

domain string

The name, or null.

Returns

string

The normalized name; empty for a null, empty or white-space name, which matches nothing.