Table of Contents

Class DnsPorts

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

Provides the destination ports that tell DNS flows to a filter, which sees only a flow's protocol and destination.

public static class DnsPorts
Inheritance
DnsPorts
Inherited Members

Remarks

DNS over HTTPS has no port of its own: on port 443, no port test can tell it from any other HTTPS flow.

Fields

Dns

The port of plain DNS, over UDP and TCP: 53.

public const int Dns = 53

Field Value

int

DnsOverTls

The port of DNS over TLS, on TCP, and of DNS over QUIC, on UDP: 853.

public const int DnsOverTls = 853

Field Value

int

Methods

IsDnsPort(int)

Determines whether a port is one of DNS's, over UDP or TCP.

public static bool IsDnsPort(int port)

Parameters

port int

The destination port.

Returns

bool

true if the port is 53 or 853; otherwise, false.

IsSecureDns(IpProtocol, int)

Determines whether a flow is secure DNS: DNS over TLS, on TCP port 853, or DNS over QUIC (RFC 9250), on UDP port 853.

public static bool IsSecureDns(IpProtocol protocol, int port)

Parameters

protocol IpProtocol

The flow's protocol.

port int

The destination port.

Returns

bool

true if the flow is TCP or UDP to port 853; otherwise, false.