API Reference
Configuration
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
- Property ClientX.EndpointConfiguration
Accepted by parameters
- Constructor ClientX.ClientX
- Method DnsJsonResolve.ResolveJsonFormat
- Method DnsJsonResolve.ResolveJsonFormatPost
- Method DnsResponse.AddServerDetails
- Method DnsWireResolve.ResolveWireFormatGet
- Method DnsWireResolveDot.ResolveWireFormatDoT
- Method DnsWireResolveGrpc.ResolveWireFormatGrpc
- Method DnsWireResolveHttp2.ResolveWireFormatHttp2
- Method DnsWireResolveHttp3.ResolveWireFormatHttp3
- Method DnsWireResolvePost.ResolveWireFormatPost
- Method DnsWireResolveQuic.ResolveWireFormatQuic
- Method DnsWireResolveTcp.ResolveWireFormatTcp
- Method DnsWireResolveUdp.ResolveWireFormatUdp
- Method DnsWireUpdateTcp.DeleteRecordAsync
- Method DnsWireUpdateTcp.UpdateRecordAsync
Constructors
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
- The hostname of the DNS-over-HTTPS resolver.
- requestFormat DnsClientX.DnsRequestFormat = First
- 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
- The base URI to send DNS requests to.
- requestFormat DnsClientX.DnsRequestFormat
- 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
- The DNS endpoint to use.
- selectionStrategy DnsClientX.DnsSelectionStrategy
- DNS Selection Strategy
Exceptions
ArgumentException– Thrown when an invalid endpoint is provided.
Methods
public Void SelectHostNameStrategy() #VoidSelects the Dns server based on the selection strategy.
Inherited Methods
Properties
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 DefaultMaxConnectionsPerServer #Default connection limit per server for HTTP requests.
10public Int32 TimeOut #Time-out for DNS Query in milliseconds. Valid only for UDP (for now).