API Reference
ClientX
The primary class for sending DNS over HTTPS queries.
Inheritance
- Object
- ClientX
Remarks
All high level query methods are implemented as partial members across multiple files.
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
- Method ClientXBuilder.Build
Accepted by parameters
- Extension method ClientX.AsQueryable
- Constructor DnsQueryable.DnsQueryable
- Method DnsQueryableExtensions.AsQueryable
Constructors
public ClientX(Uri baseUri, DnsRequestFormat requestFormat, Int32 timeOutMilliseconds = 2000, String userAgent = null, Version httpVersion = null, Boolean ignoreCertificateErrors = false, Boolean enableCache = false, Boolean useTcpFallback = true, IWebProxy webProxy = null, Int32 maxConnectionsPerServer = 10) #Initializes a new instance of the ClientX class.
Parameters
- endpoint DnsClientX.DnsEndpoint = Cloudflare
- The endpoint.
- dnsSelectionStrategy DnsClientX.DnsSelectionStrategy = First
- DNS selection strategy.
- timeOutMilliseconds System.Int32 = 2000
- The timeout for DNS requests in milliseconds.
- userAgent System.String = null
- Optional User-Agent header value.
- httpVersion System.Version = null
- Optional HTTP protocol version.
- ignoreCertificateErrors System.Boolean = false
- Ignore certificate validation errors.
- enableCache System.Boolean = false
- Enable in-memory caching of responses.
- useTcpFallback System.Boolean = true
- Falls back to TCP when UDP responses are truncated.
- webProxy System.Net.IWebProxy = null
- Optional HTTP proxy.
- maxConnectionsPerServer System.Int32 = 10
- Maximum number of concurrent connections per server.
ClientX(System.String hostname, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.String userAgent, System.Version httpVersion, System.Boolean ignoreCertificateErrors, System.Boolean enableCache, System.Boolean useTcpFallback, System.Net.IWebProxy webProxy, System.Int32 maxConnectionsPerServer) #Initializes a new instance of the ClientX class.
Parameters
- hostname System.String
- The hostname.
- requestFormat DnsClientX.DnsRequestFormat
- The request format.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- userAgent System.String
- Optional User-Agent header value.
- httpVersion System.Version
- Optional HTTP protocol version.
- ignoreCertificateErrors System.Boolean
- Ignore certificate validation errors.
- enableCache System.Boolean
- Enable in-memory caching of responses.
- useTcpFallback System.Boolean
- Falls back to TCP when UDP responses are truncated.
- webProxy System.Net.IWebProxy
- Optional HTTP proxy.
- maxConnectionsPerServer System.Int32
- Maximum number of concurrent connections per server.
ClientX(System.Uri baseUri, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.String userAgent, System.Version httpVersion, System.Boolean ignoreCertificateErrors, System.Boolean enableCache, System.Boolean useTcpFallback, System.Net.IWebProxy webProxy, System.Int32 maxConnectionsPerServer) #Initializes a new instance of the ClientX class.
Parameters
- baseUri System.Uri
- The base URI.
- requestFormat DnsClientX.DnsRequestFormat
- The request format.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- userAgent System.String
- Optional User-Agent header value.
- httpVersion System.Version
- Optional HTTP protocol version.
- ignoreCertificateErrors System.Boolean
- Ignore certificate validation errors.
- enableCache System.Boolean
- Enable in-memory caching of responses.
- useTcpFallback System.Boolean
- Falls back to TCP when UDP responses are truncated.
- webProxy System.Net.IWebProxy
- Optional HTTP proxy.
- maxConnectionsPerServer System.Int32
- Maximum number of concurrent connections per server.
public ClientX(Configuration configuration, Boolean ignoreCertificateErrors = false, Boolean enableCache = false, IWebProxy webProxy = null) #Initializes a new instance of the ClientX class using a preconfigured endpoint configuration. The configuration instance is used directly and the hostname selection strategy is applied during construction.
Parameters
- configuration DnsClientX.Configuration
- The endpoint configuration to use.
- ignoreCertificateErrors System.Boolean = false
- Ignore certificate validation errors.
- enableCache System.Boolean = false
- Enable in-memory caching of responses.
- webProxy System.Net.IWebProxy = null
- Optional HTTP proxy.
Exceptions
ArgumentNullException– Thrown when configuration is null.
Methods
ConfigureClient() #Configures the client to required parameters (legacy method for backward compatibility)
ConvertToPtrFormat(System.String ipAddress) #Converts an IP address to its PTR format. This is useful for reverse DNS lookups.
Parameters
- ipAddress System.String
ConvertToPunycode(System.String domainName) #Converts a domain name to its Punycode representation. This is useful for internationalized domain names (IDNs). For example www.bücher.de will be converted to www.xn--bcher-kva.de
Parameters
- domainName System.String
CreateOptimizedHttpClient() #Creates an optimized HttpClient with proper connection management and realistic timeouts
public async Task<DnsResponse> DeleteRecordAsync(String zone, String name, DnsRecordType type, CancellationToken cancellationToken = null) #Task<DnsResponse>Sends a DNS UPDATE request to delete a record from a zone.
Parameters
- zone System.String
- Zone containing the record.
- name System.String
- Record name.
- type DnsClientX.DnsRecordType
- Type of record.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
DNS response returned by the server.
Exceptions
DnsClientException– Thrown when the server returns an error.
public async Task<DnsService[]> DiscoverServices(String domain, CancellationToken cancellationToken = null) #Task<DnsService[]>Discovers DNS-SD services under the specified domain.
Parameters
- domain System.String
- Domain name to look up for advertised services.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
An array of discovered services or an empty array if none found.
Exceptions
ArgumentNullException– Thrown when domain is null or whitespace.
Dispose(System.Boolean disposing) #Disposes managed resources.
Parameters
- disposing System.Boolean
- Whether managed resources should be disposed.
public virtual async ValueTask DisposeAsync() #ValueTaskDisposeAsyncCore() #Disposes managed resources asynchronously when possible.
Returns
A task representing the asynchronous disposal.
public IAsyncEnumerable<DnsService> EnumerateServicesAsync(String domain, CancellationToken cancellationToken = null) #IAsyncEnumerable<DnsService>Streams DNS-SD services discovered under the specified domain.
Parameters
- domain System.String
- Domain name to look up for advertised services.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
An asynchronous enumeration of DnsService instances returned as soon as each service record is processed.
Exceptions
ArgumentNullException– Thrown when domain is null or whitespace.
public static IEnumerable<String> ExpandPattern(String pattern) #IEnumerable<String>Expands a pattern containing brace or range expressions into a set of DNS names.
Parameters
- pattern System.String
- The pattern which may contain brace expressions or numeric ranges.
Returns
An enumeration of expanded names.
FilterAnswers(DnsClientX.DnsAnswer[] answers, System.String filter, DnsClientX.DnsRecordType type) #Filters DNS answers based on a string filter, with special handling for TXT records that may contain multiple lines.
Parameters
- answers DnsClientX.DnsAnswer[]
- The DNS answers to filter.
- filter System.String
- The filter string to search for.
- type DnsClientX.DnsRecordType
- The DNS record type being filtered.
Returns
Filtered array of DNS answers.
FilterAnswersRegex(DnsClientX.DnsAnswer[] answers, System.Text.RegularExpressions.Regex regexFilter, DnsClientX.DnsRecordType type) #Filters DNS answers based on a regex filter, with special handling for TXT records that may contain multiple lines.
Parameters
- answers DnsClientX.DnsAnswer[]
- The DNS answers to filter.
- regexFilter System.Text.RegularExpressions.Regex
- The regex filter to match against.
- type DnsClientX.DnsRecordType
- The DNS record type being filtered.
Returns
Filtered array of DNS answers.
Finalize() #Finalizer to ensure unmanaged resources are released.
GetClient(DnsClientX.DnsSelectionStrategy strategy) #Gets the client based on the selection strategy This allows us to have multiple clients for different strategies, so performance is not affected
Parameters
- strategy DnsClientX.DnsSelectionStrategy
- The strategy.
HasMatchingAnswers(DnsClientX.DnsAnswer[] answers, System.String filter, DnsClientX.DnsRecordType type) #Checks if any answers contain matches for the given filter.
Parameters
- answers DnsClientX.DnsAnswer[]
- The DNS answers to check.
- filter System.String
- The filter string to search for.
- type DnsClientX.DnsRecordType
- The DNS record type being filtered.
Returns
True if any answer contains a match.
HasMatchingAnswersRegex(DnsClientX.DnsAnswer[] answers, System.Text.RegularExpressions.Regex regexFilter, DnsClientX.DnsRecordType type) #Checks if any answers contain matches for the given regex filter.
Parameters
- answers DnsClientX.DnsAnswer[]
- The DNS answers to check.
- regexFilter System.Text.RegularExpressions.Regex
- The regex filter to match against.
- type DnsClientX.DnsRecordType
- The DNS record type being filtered.
Returns
True if any answer contains a match.
IsTransientResponse(DnsClientX.DnsResponse arg1) #Checks if a DnsResponse indicates a transient error that should be retried
Parameters
- arg1 DnsClientX.DnsResponse
public TimeSpan MeasureLatency(String name = "example.com", DnsRecordType type = A, CancellationToken cancellationToken = null) #TimeSpanSends a simple DNS query and returns the round-trip time. Synchronous version.
Parameters
- name System.String = "example.com"
- Domain name to query. Defaults to example.com.
- type DnsClientX.DnsRecordType = A
- DNS record type to query. Defaults to A.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
Latency measured for the DNS query.
public async Task<TimeSpan> MeasureLatencyAsync(String name = "example.com", DnsRecordType type = A, CancellationToken cancellationToken = null) #Task<TimeSpan>Sends a simple DNS query and returns the round-trip time.
Parameters
- name System.String = "example.com"
- Domain name to query. Defaults to example.com.
- type DnsClientX.DnsRecordType = A
- DNS record type to query. Defaults to A.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
Latency measured for the DNS query.
public static Task<DnsResponse> QueryDns(String name, DnsRecordType recordType, DnsQueryOptions options, CancellationToken cancellationToken = null) #Task<DnsResponse>Sends a DNS query for a specific record type using a shared options object.
Parameters
- name System.String
- The domain name to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- options DnsClientX.DnsQueryOptions
- Shared query options.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response.
public static async Task<DnsResponse[]> QueryDns(String[] name, DnsRecordType[] recordType, String hostName, DnsRequestFormat requestFormat, Int32 timeOutMilliseconds = 2000, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, CancellationToken cancellationToken = null) #Task<DnsResponse[]>Sends a DNS query for a specific record type to a DNS server. This method allows you to specify the DNS endpoint from a predefined list of endpoints.
Parameters
- name System.String
- The domain name to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- dnsEndpoint DnsClientX.DnsEndpoint = System
- The DNS endpoint to use for the query. Defaults to System.
- dnsSelectionStrategy DnsClientX.DnsSelectionStrategy = First
- The DNS selection strategy. Defaults to First
- timeOutMilliseconds System.Int32 = 2000
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors
- maxRetries System.Int32 = 3
- Maximum number of retries
- retryDelayMs System.Int32 = 200
- Retry delay in milliseconds
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- typedRecords System.Boolean = false
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response.
QueryDns(System.String[] name, DnsClientX.DnsRecordType recordType, DnsClientX.DnsEndpoint dnsEndpoint, DnsClientX.DnsSelectionStrategy dnsSelectionStrategy, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple names for a specific record type to a DNS server. This method allows you to specify the DNS endpoint from a predefined list of endpoints.
Parameters
- name System.String[]
- The domain names to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- dnsEndpoint DnsClientX.DnsEndpoint
- The DNS endpoint to use for the query. Defaults to System.
- dnsSelectionStrategy DnsClientX.DnsSelectionStrategy
- The DNS selection strategy. Defaults to First
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response.
QueryDns(System.String name, DnsClientX.DnsRecordType recordType, System.Uri dnsUri, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for a specific record type to a DNS server. This method allows you to specify the DNS endpoint by providing a full URI and request format (JSON, WireFormatGet).
Parameters
- name System.String
- The domain name to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- dnsUri System.Uri
- The full URI of the DNS server to query.
- requestFormat DnsClientX.DnsRequestFormat
- The format of the DNS request.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response.
QueryDns(System.String[] name, DnsClientX.DnsRecordType[] recordType, System.Uri dnsUri, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple domain names and multiple record types to a DNS server using a full URI and request format.
Parameters
- name System.String[]
- The name.
- recordType DnsClientX.DnsRecordType[]
- Type of the record.
- dnsUri System.Uri
- The DNS URI.
- requestFormat DnsClientX.DnsRequestFormat
- The request format.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
public static async Task<DnsResponse[]> QueryDns(String[] name, DnsRecordType[] recordType, DnsEndpoint dnsEndpoint = System, Int32 timeOutMilliseconds = 2000, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, CancellationToken cancellationToken = null) #Task<DnsResponse[]>Sends a DNS query for a specific record type to a DNS server. This method allows you to specify the DNS endpoint by providing a hostname and request format (JSON, WireFormatGet).
Parameters
- name System.String
- The domain name to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- hostName System.String = System
- The hostname of the DNS server to query.
- requestFormat DnsClientX.DnsRequestFormat = 2000
- The format of the DNS request.
- timeOutMilliseconds System.Int32 = true
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean = 3
- Whether to retry on transient errors
- maxRetries System.Int32 = 200
- Maximum number of retries
- retryDelayMs System.Int32 = false
- Retry delay in milliseconds
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response.
QueryDns(System.String[] name, DnsClientX.DnsRecordType[] recordType, System.String hostName, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple domain names and multiple record types to a DNS server using HostName and RequestFormat.
Parameters
- name System.String[]
- The name.
- recordType DnsClientX.DnsRecordType[]
- Type of the record.
- hostName System.String
- Name of the host.
- requestFormat DnsClientX.DnsRequestFormat
- The request format.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
QueryDns(System.String[] name, DnsClientX.DnsRecordType recordType, System.String hostName, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple domain names and multiple record types to a DNS server using HostName and RequestFormat.
Parameters
- name System.String[]
- The name.
- recordType DnsClientX.DnsRecordType
- Type of the record.
- hostName System.String
- Name of the host.
- requestFormat DnsClientX.DnsRequestFormat
- The request format.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
QueryDns(System.String[] name, DnsClientX.DnsRecordType[] recordType, DnsClientX.DnsEndpoint dnsEndpoint, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple domain names and single record types to a DNS server using HostName and RequestFormat.
Parameters
- name System.String[]
- The name.
- recordType DnsClientX.DnsRecordType[]
- Type of the record.
- dnsEndpoint DnsClientX.DnsEndpoint
- The DNS endpoint. Default endpoint is System
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
public static Task<DnsResponse[]> QueryDns(ResolveDnsRequest request, CancellationToken cancellationToken = null) #Task<DnsResponse[]>Executes a DNS query request that can target single resolvers, explicit servers, or the multi-resolver.
Parameters
- request DnsClientX.ResolveDnsRequest
- The reusable DNS query request.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task producing all responses generated by the request.
public static DnsResponse[] QueryDnsSync(String[] name, DnsRecordType[] recordType, String hostName, DnsRequestFormat requestFormat, Int32 timeOutMilliseconds = 2000, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, CancellationToken cancellationToken = null) #DnsResponse[]Sends a DNS query for a specific record type to a DNS server. Synchronous version. This method allows you to specify the DNS endpoint from a predefined list of endpoints.
Parameters
- name System.String
- The domain name to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- dnsEndpoint DnsClientX.DnsEndpoint = System
- The DNS endpoint to use for the query. Defaults to System.
- dnsSelectionStrategy DnsClientX.DnsSelectionStrategy = First
- The DNS selection strategy. Defaults to First
- timeOutMilliseconds System.Int32 = 2000
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors
- maxRetries System.Int32 = 3
- Maximum number of retries
- retryDelayMs System.Int32 = 200
- Retry delay in milliseconds
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- typedRecords System.Boolean = false
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
The DNS response.
QueryDnsSync(System.String[] name, DnsClientX.DnsRecordType recordType, DnsClientX.DnsEndpoint dnsEndpoint, DnsClientX.DnsSelectionStrategy dnsSelectionStrategy, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple names for a specific record type to a DNS server. Synchronous version. This method allows you to specify the DNS endpoint from a predefined list of endpoints.
Parameters
- name System.String[]
- The domain names to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- dnsEndpoint DnsClientX.DnsEndpoint
- The DNS endpoint to use for the query. Defaults to System.
- dnsSelectionStrategy DnsClientX.DnsSelectionStrategy
- The DNS selection strategy. Defaults to First
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
The DNS response.
QueryDnsSync(System.String name, DnsClientX.DnsRecordType recordType, System.Uri dnsUri, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for a specific record type to a DNS server. Synchronous version. This method allows you to specify the DNS endpoint by providing a full URI and request format (JSON, WireFormatGet).
Parameters
- name System.String
- The domain name to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- dnsUri System.Uri
- The full URI of the DNS server to query.
- requestFormat DnsClientX.DnsRequestFormat
- The format of the DNS request.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
The DNS response.
QueryDnsSync(System.String[] name, DnsClientX.DnsRecordType[] recordType, System.Uri dnsUri, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple domain names and multiple record types to a DNS server using a full URI and request format. Synchronous version.
Parameters
- name System.String[]
- The name.
- recordType DnsClientX.DnsRecordType[]
- Type of the record.
- dnsUri System.Uri
- The DNS URI.
- requestFormat DnsClientX.DnsRequestFormat
- The request format.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
public static DnsResponse[] QueryDnsSync(String[] name, DnsRecordType[] recordType, DnsEndpoint dnsEndpoint = System, Int32 timeOutMilliseconds = 2000, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, CancellationToken cancellationToken = null) #DnsResponse[]Sends a DNS query for a specific record type to a DNS server. Synchronous version. This method allows you to specify the DNS endpoint by providing a hostname and request format (JSON, WireFormatGet).
Parameters
- name System.String
- The domain name to query.
- recordType DnsClientX.DnsRecordType
- The type of DNS record to query.
- hostName System.String = System
- The hostname of the DNS server to query.
- requestFormat DnsClientX.DnsRequestFormat = 2000
- The format of the DNS request.
- timeOutMilliseconds System.Int32 = true
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean = 3
- Whether to retry on transient errors
- maxRetries System.Int32 = 200
- Maximum number of retries
- retryDelayMs System.Int32 = false
- Retry delay in milliseconds
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
The DNS response.
QueryDnsSync(System.String[] name, DnsClientX.DnsRecordType[] recordType, System.String hostName, DnsClientX.DnsRequestFormat requestFormat, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query for multiple domain names and multiple record types to a DNS server using HostName and RequestFormat. Synchronous version.
Parameters
- name System.String[]
- The name.
- recordType DnsClientX.DnsRecordType[]
- Type of the record.
- hostName System.String
- Name of the host.
- requestFormat DnsClientX.DnsRequestFormat
- The request format.
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
QueryDnsSync(System.String[] name, DnsClientX.DnsRecordType[] recordType, DnsClientX.DnsEndpoint dnsEndpoint, System.Int32 timeOutMilliseconds, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Sends a DNS query to multiple domains and multiple record types to a DNS server. Synchronous version. This method allows you to specify the DNS endpoint by providing a hostname and request format (JSON, WireFormatGet).
Parameters
- name System.String[]
- Multiple domain names to check for given type
- recordType DnsClientX.DnsRecordType[]
- Multiple types to check for given name.
- dnsEndpoint DnsClientX.DnsEndpoint
- The DNS endpoint. Default endpoint is System
- timeOutMilliseconds System.Int32
- The timeout for DNS requests in milliseconds.
- retryOnTransient System.Boolean
- Whether to retry on transient errors
- maxRetries System.Int32
- Maximum number of retries
- retryDelayMs System.Int32
- Retry delay in milliseconds
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
public static DnsResponse[] QueryDnsSync(ResolveDnsRequest request, CancellationToken cancellationToken = null) #DnsResponse[]Executes a DNS query request synchronously.
Parameters
- request DnsClientX.ResolveDnsRequest
- The reusable DNS query request.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
The responses generated by the request.
public async Task<DnsResponse[]> Resolve(String[] names, DnsRecordType type, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean returnAllTypes = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, CancellationToken cancellationToken = null) #Task<DnsResponse[]>Resolves a domain name using DNS over HTTPS. This method provides full control over the output.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean = false
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 200
- The delay between retries in milliseconds.
- typedRecords System.Boolean = false
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response.
Exceptions
DnsClientException– Thrown when an invalid RequestFormat is provided.ArgumentNullException– Thrown when the provided name is null or empty.
Resolve(System.String name, DnsClientX.DnsRecordType[] types, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Resolves multiple DNS resource types for a domain name in parallel using DNS over HTTPS.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- types DnsClientX.DnsRecordType[]
- The array of DNS resource record types to resolve. By default, this is the A record.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of DNS responses.
Exceptions
DnsClientException– Thrown when an invalid RequestFormat is provided.ArgumentNullException– Thrown when the provided name is null or empty.
Resolve(System.String[] names, DnsClientX.DnsRecordType[] types, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names for multiple DNS record types in parallel using DNS over HTTPS.
Parameters
- names System.String[]
- The array of domain names to resolve.
- types DnsClientX.DnsRecordType[]
- The array of DNS resource record types to resolve.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of DNS responses.
Resolve(System.String[] names, DnsClientX.DnsRecordType type, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names for single DNS record type in parallel using DNS over HTTPS.
Parameters
- names System.String[]
- The names.
- type DnsClientX.DnsRecordType
- The type.
- requestDnsSec System.Boolean
- if set to true [request DNS sec].
- validateDnsSec System.Boolean
- if set to true [validate DNS sec].
- returnAllTypes System.Boolean
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
The array of DNS responses from all queries.
public async Task<DnsAnswer[]> ResolveAll(String name, DnsRecordType type = A, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #Task<DnsAnswer[]>Resolves a domain name using DNS over HTTPS and returns all answers of the provided type. This helper method is useful when you need all answers of a specific type.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 100
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of all DNS answers of the provided type.
public async Task<DnsAnswer[]> ResolveAll(String name, Regex regexPattern, DnsRecordType type = A, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #Task<DnsAnswer[]>Resolves a domain name using DNS over HTTPS and returns all answers of the provided type. This helper method is useful when you need all answers of a specific type.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- filter System.String
- Filter out results based on string. It can be helpful to filter out records such as SPF1 in TXT
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 100
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of all DNS answers of the provided type.
ResolveAll(System.String name, System.Text.RegularExpressions.Regex regexPattern, DnsClientX.DnsRecordType type, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves a domain name using DNS over HTTPS and returns all answers of the provided type. This helper method is useful when you need all answers of a specific type.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- regexPattern System.Text.RegularExpressions.Regex
- Filter out results based on Regex Pattern. It can be helpful to filter out records such as SPF1 in TXT
- type DnsClientX.DnsRecordType
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of all DNS answers of the provided type.
public DnsAnswer[] ResolveAllSync(String name, DnsRecordType type = A, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, CancellationToken cancellationToken = null) #DnsAnswer[]Resolves a domain name using DNS over HTTPS and returns all answers of the provided type. This helper method is useful when you need all answers of a specific type.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 200
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of all DNS answers of the provided type.
public DnsAnswer[] ResolveAllSync(String name, Regex regexPattern, DnsRecordType type = A, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, CancellationToken cancellationToken = null) #DnsAnswer[]Resolves a domain name using DNS over HTTPS and returns all answers of the provided type. This helper method is useful when you need all answers of a specific type.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- filter System.String
- Filter out results based on string. It can be helpful to filter out records such as SPF1 in TXT
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 200
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of all DNS answers of the provided type.
ResolveAllSync(System.String name, System.Text.RegularExpressions.Regex regexPattern, DnsClientX.DnsRecordType type, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves a domain name using DNS over HTTPS and returns all answers of the provided type. This helper method is useful when you need all answers of a specific type.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- regexPattern System.Text.RegularExpressions.Regex
- Filter out results based on Regex Pattern. It can be helpful to filter out records such as SPF1 in TXT
- type DnsClientX.DnsRecordType
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains an array of all DNS answers of the provided type.
public IAsyncEnumerable<DnsResponse> ResolveAsyncEnumerable(String[] names, DnsRecordType type, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean returnAllTypes = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, CancellationToken cancellationToken = null) #IAsyncEnumerable<DnsResponse>Resolves multiple DNS record types for a single domain name concurrently and yields responses as they complete.
Parameters
- name System.String
- types DnsClientX.DnsRecordType[]
- requestDnsSec System.Boolean = false
- validateDnsSec System.Boolean = false
- returnAllTypes System.Boolean = false
- retryOnTransient System.Boolean = true
- maxRetries System.Int32 = 3
- retryDelayMs System.Int32 = 200
- cancellationToken System.Threading.CancellationToken = null
ResolveAsyncEnumerable(System.String[] names, DnsClientX.DnsRecordType[] types, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names and DNS record types concurrently and yields responses as they complete.
Parameters
- names System.String[]
- types DnsClientX.DnsRecordType[]
- requestDnsSec System.Boolean
- validateDnsSec System.Boolean
- returnAllTypes System.Boolean
- retryOnTransient System.Boolean
- maxRetries System.Int32
- retryDelayMs System.Int32
- cancellationToken System.Threading.CancellationToken
ResolveAsyncEnumerable(System.String[] names, DnsClientX.DnsRecordType type, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names for a single DNS record type concurrently and yields responses as they complete.
Parameters
- names System.String[]
- type DnsClientX.DnsRecordType
- requestDnsSec System.Boolean
- validateDnsSec System.Boolean
- returnAllTypes System.Boolean
- retryOnTransient System.Boolean
- maxRetries System.Int32
- retryDelayMs System.Int32
- cancellationToken System.Threading.CancellationToken
public async Task<DnsResponse> ResolveFilter(String name, DnsRecordType type, Regex regexFilter, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #Task<DnsResponse>Resolves multiple domain names for a single DNS record type in parallel using DNS over HTTPS. This method allows you to specify a filter that will be applied to the data of the DNS answers.
Parameters
- names System.String[]
- The domain names to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- filter System.String
- The filter to apply to the DNS answers data.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 100
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS responses that match the filter.
public async Task<DnsResponse> ResolveFilter(String name, DnsRecordType type, Regex regexFilter, ResolveFilterOptions options, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #Task<DnsResponse>Resolves multiple domain names for a single DNS record type in parallel using DNS over HTTPS. This method allows you to specify a filter that will be applied to the data of the DNS answers.
Parameters
- names System.String[]
- The domain names to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- filter System.String
- The filter to apply to the DNS answers data.
- options DnsClientX.ResolveFilterOptions
- Options for filtering, including alias inclusion.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 100
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS responses that match the filter.
ResolveFilter(System.String[] names, DnsClientX.DnsRecordType type, System.Text.RegularExpressions.Regex regexFilter, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names for a single DNS record type in parallel using DNS over HTTPS. This method allows you to specify a regular expression filter that will be applied to the data of the DNS answers.
Parameters
- names System.String[]
- The domain names to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- regexFilter System.Text.RegularExpressions.Regex
- The regular expression filter to apply to the DNS answers data.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS responses that match the filter.
ResolveFilter(System.String[] names, DnsClientX.DnsRecordType type, System.Text.RegularExpressions.Regex regexFilter, DnsClientX.ResolveFilterOptions options, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names for a single DNS record type in parallel using DNS over HTTPS. This method allows you to specify a regular expression filter that will be applied to the data of the DNS answers.
Parameters
- names System.String[]
- The domain names to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- regexFilter System.Text.RegularExpressions.Regex
- The regular expression filter to apply to the DNS answers data.
- options DnsClientX.ResolveFilterOptions
- Options for filtering, including alias inclusion.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS responses that match the filter.
ResolveFilter(System.String name, DnsClientX.DnsRecordType type, System.String filter, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves a single domain name for a single DNS record type using DNS over HTTPS. This method allows you to specify a filter that will be applied to the data of the DNS answers.
Parameters
- name System.String
- The domain name to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- filter System.String
- The filter to apply to the DNS answers data.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response that matches the filter.
ResolveFilter(System.String name, DnsClientX.DnsRecordType type, System.String filter, DnsClientX.ResolveFilterOptions options, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves a single domain name for a single DNS record type using DNS over HTTPS. This method allows you to specify a filter that will be applied to the data of the DNS answers.
Parameters
- name System.String
- The domain name to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- filter System.String
- The filter to apply to the DNS answers data.
- options DnsClientX.ResolveFilterOptions
- Options for filtering, including alias inclusion.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response that matches the filter.
ResolveFilter(System.String name, DnsClientX.DnsRecordType type, System.Text.RegularExpressions.Regex regexFilter, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves a single domain name for a single DNS record type using DNS over HTTPS. This method allows you to specify a regular expression filter that will be applied to the data of the DNS answers.
Parameters
- name System.String
- The domain name to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- regexFilter System.Text.RegularExpressions.Regex
- The regular expression filter to apply to the DNS answers data.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response that matches the filter.
ResolveFilter(System.String name, DnsClientX.DnsRecordType type, System.Text.RegularExpressions.Regex regexFilter, DnsClientX.ResolveFilterOptions options, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves a single domain name for a single DNS record type using DNS over HTTPS. This method allows you to specify a regular expression filter that will be applied to the data of the DNS answers.
Parameters
- name System.String
- The domain name to resolve.
- type DnsClientX.DnsRecordType
- The type of DNS record to resolve.
- regexFilter System.Text.RegularExpressions.Regex
- The regular expression filter to apply to the DNS answers data.
- options DnsClientX.ResolveFilterOptions
- Options for filtering, including alias inclusion.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the DNS response that matches the filter.
public async Task<Nullable<DnsAnswer>> ResolveFirst(String name, DnsRecordType type = A, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #Task<Nullable<DnsAnswer>>Resolves a domain name using DNS over HTTPS and returns the first answer of the provided type. This helper method is useful when you only need the first answer of a specific type. Alternatively, CancellationToken) may be used to get full control over the response.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- typedRecords System.Boolean = false
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 100
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
A task that represents the asynchronous operation. The task result contains the first DNS answer of the provided type, or null if no such answer exists.
public Nullable<DnsAnswer> ResolveFirstSync(String name, DnsRecordType type = A, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #Nullable<DnsAnswer>Resolves a domain name using DNS over HTTPS and returns the first answer of the provided type. Synchronous version.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- typedRecords System.Boolean = false
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 100
- The delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
The first DNS answer of the provided type, or null if no such answer exists.
ResolveForSd(System.String name, DnsClientX.DnsRecordType type, System.Threading.CancellationToken cancellationToken) #Resolves a DNS query specifically for service discovery, allowing tests to override the resolver.
Parameters
- name System.String
- The fully qualified domain name to query.
- type DnsClientX.DnsRecordType
- The DNS record type.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
public async Task<DnsResponse> ResolveFromRoot(String name, DnsRecordType type = A, IEnumerable<String> servers = null, Int32 maxRetries = 10, Int32 port = 53, CancellationToken cancellationToken = null) #Task<DnsResponse>Resolves a domain name by iteratively querying root servers and following NS referrals until an answer is obtained.
Parameters
- name System.String
- Domain name to resolve.
- type DnsClientX.DnsRecordType = A
- Record type to resolve.
- servers System.Collections.Generic.IEnumerable{System.String} = null
- Optional list of root servers to query.
- maxRetries System.Int32 = 10
- Maximum referral retries.
- port System.Int32 = 53
- Port used to query each server.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
public async Task<DnsResponse[]> ResolvePattern(String pattern, DnsRecordType type = A, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean returnAllTypes = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false, CancellationToken cancellationToken = null) #Task<DnsResponse[]>Resolves a domain name pattern by expanding wildcards into multiple queries. Supported patterns include numeric ranges like server[1-3].example.com and brace expansions such as host{a,b}.example.com.
Parameters
- pattern System.String
- The pattern containing wildcards.
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean = false
- Whether to return all record types.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- Maximum number of retries.
- retryDelayMs System.Int32 = 200
- Delay between retries in milliseconds.
- typedRecords System.Boolean = false
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
Array of DNS responses for each expanded query.
public async Task<DnsSrvRecord[]> ResolveServiceAsync(String service, String protocol, String domain, Boolean resolveHosts = false, CancellationToken cancellationToken = null) #Task<DnsSrvRecord[]>Resolves SRV records for a specific service and protocol under a domain.
Parameters
- service System.String
- Service name without leading underscore, e.g. ldap.
- protocol System.String
- Protocol name without leading underscore, e.g. tcp.
- domain System.String
- Domain hosting the service.
- resolveHosts System.Boolean = false
- Whether to resolve A and AAAA records for each target.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
Ordered SRV records parsed from the response.
Exceptions
ArgumentNullException– Thrown when any parameter is null or whitespace.
public IAsyncEnumerable<DnsResponse> ResolveStream(String[] names, DnsRecordType type, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean returnAllTypes = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, CancellationToken cancellationToken = null) #IAsyncEnumerable<DnsResponse>Resolves multiple DNS record types for a single domain name and streams the responses.
Parameters
- name System.String
- Domain name to resolve.
- types DnsClientX.DnsRecordType[]
- Record types to resolve.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean = false
- Whether to return all record types.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- Maximum number of retries.
- retryDelayMs System.Int32 = 200
- Delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
ResolveStream(System.String[] names, DnsClientX.DnsRecordType[] types, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names for multiple DNS record types and streams the responses.
Parameters
- names System.String[]
- Domain names to resolve.
- types DnsClientX.DnsRecordType[]
- Record types to resolve.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean
- Whether to return all record types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- Maximum number of retries.
- retryDelayMs System.Int32
- Delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
ResolveStream(System.String[] names, DnsClientX.DnsRecordType type, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Threading.CancellationToken cancellationToken) #Resolves multiple domain names for a single DNS record type and streams the responses.
Parameters
- names System.String[]
- Domain names to resolve.
- type DnsClientX.DnsRecordType
- Record type to resolve.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean
- Whether to return all record types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- Maximum number of retries.
- retryDelayMs System.Int32
- Delay between retries in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
public DnsResponse[] ResolveSync(String[] names, DnsRecordType type, Boolean requestDnsSec = false, Boolean validateDnsSec = false, Boolean returnAllTypes = false, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 200, Boolean typedRecords = false, Boolean parseTypedTxtRecords = false) #DnsResponse[]Resolves a domain name using DNS over HTTPS. This method provides full control over the output. Synchronous version.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- type DnsClientX.DnsRecordType = A
- The DNS resource type to resolve. By default, this is the A record.
- requestDnsSec System.Boolean = false
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean = false
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean = false
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean = true
- Whether to retry on transient errors.
- maxRetries System.Int32 = 3
- The maximum number of retries.
- retryDelayMs System.Int32 = 200
- The delay between retries in milliseconds.
- typedRecords System.Boolean = false
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean = false
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
Returns
The DNS response.
Exceptions
DnsClientException– Thrown when an invalid RequestFormat is provided.ArgumentNullException– Thrown when the provided name is null or empty.
ResolveSync(System.String name, DnsClientX.DnsRecordType[] types, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords) #Resolves multiple DNS resource types for a domain name in parallel using DNS over HTTPS. Synchronous version.
Parameters
- name System.String
- The fully qualified domain name (FQDN) to resolve. Example: foo.bar.example.com
- types DnsClientX.DnsRecordType[]
- The array of DNS resource record types to resolve. By default, this is the A record.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
Returns
An array of DNS responses.
Exceptions
DnsClientException– Thrown when an invalid RequestFormat is provided.ArgumentNullException– Thrown when the provided name is null or empty.
ResolveSync(System.String[] names, DnsClientX.DnsRecordType[] types, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords) #Resolves multiple domain names for multiple DNS record types in parallel using DNS over HTTPS. Synchronous version.
Parameters
- names System.String[]
- The array of domain names to resolve.
- types DnsClientX.DnsRecordType[]
- The array of DNS resource record types to resolve.
- requestDnsSec System.Boolean
- Whether to request DNSSEC data in the response. When requested, it will be accessible under the DnsAnswer array.
- validateDnsSec System.Boolean
- Whether to validate DNSSEC data.
- returnAllTypes System.Boolean
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
Returns
An array of DNS responses.
ResolveSync(System.String[] names, DnsClientX.DnsRecordType type, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean returnAllTypes, System.Boolean retryOnTransient, System.Int32 maxRetries, System.Int32 retryDelayMs, System.Boolean typedRecords, System.Boolean parseTypedTxtRecords) #Resolves multiple domain names for single DNS record type in parallel using DNS over HTTPS. Synchronous version.
Parameters
- names System.String[]
- The names.
- type DnsClientX.DnsRecordType
- The type.
- requestDnsSec System.Boolean
- if set to true [request DNS sec].
- validateDnsSec System.Boolean
- if set to true [validate DNS sec].
- returnAllTypes System.Boolean
- Whether to return all DNS record types in the response as returned by provider. When set to true, the Answers array will contain all types.
- retryOnTransient System.Boolean
- Whether to retry on transient errors.
- maxRetries System.Int32
- The maximum number of retries.
- retryDelayMs System.Int32
- The delay between retries in milliseconds.
- typedRecords System.Boolean
- Return answers as typed records.
- parseTypedTxtRecords System.Boolean
- Whether to parse TXT records into specialized types (DMARC, SPF, etc.). When false, returns simple TXT records.
Returns
An array of DNS responses.
RetryAsync``1(System.Func{System.Threading.Tasks.Task{``0}} action, System.Int32 maxRetries, System.Int32 delayMs, System.Action beforeRetry, System.Action{System.String} onRetry, System.Boolean useJitter, System.Threading.CancellationToken cancellationToken) #Executes the provided asynchronous action with retry logic.
Type Parameters
- T
- Type returned by the action.
Parameters
- action System.Func{System.Threading.Tasks.Task{``0}}
- The asynchronous operation to execute.
- maxRetries System.Int32
- Maximum number of attempts before giving up.
- delayMs System.Int32
- Base delay between retries in milliseconds. The actual wait time grows exponentially with a random jitter.
- beforeRetry System.Action
- Optional callback invoked before each retry attempt.
- onRetry System.Action{System.String}
- Optional callback invoked with a short reason describing why the retry was triggered.
- useJitter System.Boolean
- Whether to randomize delays with jitter for exponential backoff.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel waits between retries.
public async Task<DnsResponse> UpdateRecordAsync(String zone, String name, DnsRecordType type, String data, Int32 ttl = 300, CancellationToken cancellationToken = null) #Task<DnsResponse>Sends a DNS UPDATE request to add or modify a record in a zone.
Parameters
- zone System.String
- Zone to update.
- name System.String
- Record name.
- type DnsClientX.DnsRecordType
- Type of record.
- data System.String
- Record data.
- ttl System.Int32 = 300
- Time to live for the record.
- cancellationToken System.Threading.CancellationToken = null
- Token used to cancel the operation.
Returns
DNS response returned by the server.
Exceptions
DnsClientException– Thrown when the server returns an error.
public async Task<ZoneTransferResult[]> ZoneTransferAsync(String zone, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #Task<ZoneTransferResult[]>Performs a DNS zone transfer (AXFR) using TCP.
Parameters
- zone System.String
- Zone name to transfer.
- retryOnTransient System.Boolean = true
- Whether to retry on transient failures.
- maxRetries System.Int32 = 3
- Maximum number of retry attempts.
- retryDelayMs System.Int32 = 100
- Base delay in milliseconds between retries.
- cancellationToken System.Threading.CancellationToken = null
- Cancellation token.
Returns
Ordered RRsets as returned by the server.
Exceptions
ArgumentNullExceptionDnsClientException– When the transfer fails.
public IAsyncEnumerable<ZoneTransferResult> ZoneTransferStreamAsync(String zone, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #IAsyncEnumerable<ZoneTransferResult>Performs a DNS zone transfer (AXFR) using TCP and streams the RRsets as they are processed.
Parameters
- zone System.String
- Zone name to transfer.
- retryOnTransient System.Boolean = true
- Whether to retry on transient failures.
- maxRetries System.Int32 = 3
- Maximum number of retry attempts.
- retryDelayMs System.Int32 = 100
- Base delay in milliseconds between retries.
- cancellationToken System.Threading.CancellationToken = null
- Cancellation token.
Returns
An asynchronous enumeration of ordered RRsets.
public ZoneTransferResult[] ZoneTransferSync(String zone, Boolean retryOnTransient = true, Int32 maxRetries = 3, Int32 retryDelayMs = 100, CancellationToken cancellationToken = null) #ZoneTransferResult[]Performs a DNS zone transfer (AXFR) synchronously.
Parameters
- zone System.String
- Zone name to transfer.
- retryOnTransient System.Boolean = true
- Whether to retry on transient failures.
- maxRetries System.Int32 = 3
- Maximum number of retry attempts.
- retryDelayMs System.Int32 = 100
- Base delay in milliseconds between retries.
- cancellationToken System.Threading.CancellationToken = null
- Cancellation token.
Returns
Ordered RRsets as returned by the server.
Inherited Methods
Properties
public Configuration EndpointConfiguration { get; set; } #Gets the endpoint configuration.
Value
The endpoint configuration.
public Boolean Debug { get; set; } #Gets or sets a value indicating whether this ClientX is debug.
Value
true if debug; otherwise, false.
public Boolean IgnoreCertificateErrors { get; set; } #Gets or sets a value indicating whether [ignore certificate errors].
Value
true if [ignore certificate errors]; otherwise, false.
public Boolean CacheEnabled { get; } #Gets a value indicating whether caching is enabled.
public TimeSpan CacheExpiration { get; set; } #Gets or sets the default expiration time for cached entries.
public TimeSpan MinCacheTtl { get; set; } #Gets or sets the minimal TTL allowed for cached responses.
public TimeSpan MaxCacheTtl { get; set; } #Gets or sets the maximal TTL allowed for cached responses.
public Boolean EnableAudit { get; set; } #Gets or sets a value indicating whether audit logging is enabled.
public IReadOnlyCollection<AuditEntry> AuditTrail { get; } #Gets the audit trail entries recorded during the lifetime of the client.
public SecurityProtocolType SecurityProtocol { get; set; } #Gets or sets the security protocol. The default value is Tls12 which is required by Quad 9.
Value
The security protocol.
Fields
Extension Methods
public static DnsQueryable AsQueryable(ClientX client, IEnumerable<String> names, DnsRecordType type) #DnsQueryableCreates a DNS LINQ query for the specified domains and record type.
Parameters
- client DnsClientX.ClientX
- DNS client.
- names System.Collections.Generic.IEnumerable{System.String}
- Domain names.
- type DnsClientX.DnsRecordType
- Record type.