Domain Detective

API Reference

Class

Configuration

Namespace DnsClientX
Assembly DnsClientX

Class representing the configuration for a DNS-over-HTTPS endpoint.

Inheritance

  • Object
  • Configuration

Remarks

Instances of this class are used by ClientXBuilder to describe the target server and connection settings.

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by

Accepted by parameters

Constructors

Configuration 3 overloads
public Configuration(DnsEndpoint endpoint, DnsSelectionStrategy selectionStrategy = First) #

Initializes a new instance of the EndpointConfiguration class with a specific hostname and request format.

Parameters

hostname System.String requiredposition: 0
The hostname of the DNS-over-HTTPS resolver.
requestFormat DnsClientX.DnsRequestFormat = First optionalposition: 1
The format of the DNS requests.
Configuration(System.Uri baseUri, DnsClientX.DnsRequestFormat requestFormat) #

Initializes a new instance of the EndpointConfiguration class with a specific base URI and request format.

Parameters

baseUri System.Uri required
The base URI to send DNS requests to.
requestFormat DnsClientX.DnsRequestFormat required
The format of the DNS requests.
Configuration(DnsClientX.DnsEndpoint endpoint, DnsClientX.DnsSelectionStrategy selectionStrategy) #

Initializes a new instance of the EndpointConfiguration class with a specific DNS endpoint.

Parameters

endpoint DnsClientX.DnsEndpoint required
The DNS endpoint to use.
selectionStrategy DnsClientX.DnsSelectionStrategy required
DNS Selection Strategy

Exceptions

  • ArgumentException – Thrown when an invalid endpoint is provided.

Methods

public Void MarkCurrentHostnameUnavailable() #
Returns: Void

Marks the current hostname as unavailable.

public Void MarkHostnameUnavailable(String host) #
Returns: Void

Marks the specified host as unavailable for the configured cooldown period.

Parameters

host System.String requiredposition: 0
public Void SelectHostNameStrategy() #
Returns: Void

Selects the Dns server based on the selection strategy.

Properties

public TimeSpan UnavailableCooldown { get; set; } #

Gets or sets the cooldown period for hosts marked as unavailable.

public TimeSpan DnsServerResolutionSuccessTtl { get; set; } #

Gets or sets how long resolved DNS server addresses stay fresh in the local cache.

public TimeSpan DnsServerResolutionFailureTtl { get; set; } #

Gets or sets how long failed DNS server resolution results are cached.

public TimeSpan DnsServerResolutionStaleTtl { get; set; } #

Gets or sets how long a stale DNS server address may be reused after resolution failures.

public Boolean DnsServerResolutionAllowStale { get; set; } #

Gets or sets whether stale DNS server addresses can be reused when resolution fails.

public Boolean DnsServerResolutionFailureBackoffEnabled { get; set; } #

Gets or sets whether repeated DNS server resolution failures should apply a backoff before retrying.

public Double DnsServerResolutionFailureBackoffFactor { get; set; } #

Gets or sets the backoff factor used to extend the failure TTL when resolution keeps failing.

public TimeSpan DnsServerResolutionFailureBackoffMaxTtl { get; set; } #

Gets or sets the maximum TTL applied when failure backoff is enabled.

public DnsSelectionStrategy SelectionStrategy { get; set; } #

Gets or sets how to select the DNS server to use when multiple are available.

Value

The selection strategy.

public String Hostname { get; set; } #

Gets the hostname of the DNS-over-HTTPS resolver.

public Uri BaseUri { get; set; } #

Gets the base URI to send DNS requests to.

public Version HttpVersion { get; set; } #

Gets or sets the HTTP version used when communicating with the DNS provider.

public String UserAgent { get; set; } #

Gets or sets the User-Agent header value to send along with DNS requests.

public Boolean ValidateRootDnsSec { get; set; } #

Validates DS and DNSKEY records against a builtin root key set.

public Boolean CheckingDisabled { get; set; } #

Sets the CD (Checking Disabled) flag on queries.

public Boolean UseTcpFallback { get; set; } #

Determines whether to fall back to TCP when a UDP response is truncated.

public Int32 MaxConnectionsPerServer { get; set; } #

Gets or sets the maximum number of HTTP connections allowed per server.

public Nullable<Int32> MaxConcurrency { get; set; } #

Optional cap for client-side query parallelism when resolving multiple names. When null, the library uses its current behavior (no explicit cap). When set to a positive value, array-based resolve helpers will limit the number of in-flight requests to this value.

public AsymmetricAlgorithm SigningKey { get; set; } #

Optional key used to sign outgoing DNS messages.

public Int32 UdpBufferSize { get; set; } #

Gets or sets the UDP buffer size used when sending EDNS queries.

Value

The size of the UDP buffer.

public Boolean EnableEdns { get; set; } #

Gets or sets a value indicating whether EDNS should be enabled for queries.

Value

true to include the OPT record; otherwise, false.

public String Subnet { get; set; } #

Gets or sets the EDNS Client Subnet (ECS) to include in DNS queries. Specify as CIDR notation, for example 192.0.2.0/24. When configured, EDNS will be automatically enabled.

public EdnsOptions EdnsOptions { get; set; } #

Gets or sets additional EDNS options. When configured, these values override EnableEdns, UdpBufferSize and Subnet.

public DnsRequestFormat RequestFormat { get; set; } #

Gets or sets the format of the DNS requests. Updating the format adjusts Port according to the same rules used by the constructors.

public Int32 Port { get; set; } #

Gets or sets the port. The default value is 53 for DNS over UDP or DNS over TCP, and 853 for DNS over TLS. Only used when the request format is DNS over TLS, or DNS over UDP or TCP. In the case of DNS over HTTPS, the port is determined by the base URI.

Value

The port.

Fields

hostnames #

Random generator used for hostname selection on frameworks lacking Random.Shared.

public static readonly Version DefaultHttpVersion #

The preferred HTTP request version to use by default.

public const Int32 DefaultTimeout #

Default timeout for DNS queries in milliseconds.

Value: 2000
public const Int32 DefaultMaxConnectionsPerServer #

Default connection limit per server for HTTP requests.

Value: 10
public Int32 TimeOut #

Time-out for DNS Query in milliseconds. Valid only for UDP (for now).

{{ include "footer" }}