API Reference
Class
DnsWireResolveTcp
Provides DNS resolution over TCP using the DNS wire protocol.
Inheritance
- Object
- DnsWireResolveTcp
Methods
ConnectAsync(System.Net.Sockets.TcpClient tcpClient, System.String host, System.Int32 port, System.Int32 timeoutMilliseconds, System.Threading.CancellationToken cancellationToken) #Connects the provided TcpClient with support for timeout and cancellation on older frameworks.
Parameters
- tcpClient System.Net.Sockets.TcpClient
- Client used for the connection.
- host System.String
- Target host.
- port System.Int32
- Target port.
- timeoutMilliseconds System.Int32
- Timeout in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
ReadExactWithTimeoutAsync(System.IO.Stream arg1, System.Byte[] arg2, System.Int32 arg3, System.Int32 arg4, System.Int32 arg5, System.Threading.CancellationToken arg6) #Helper to read exactly the requested number of bytes from a stream with timeout.
Parameters
- arg1 System.IO.Stream
- arg2 System.Byte[]
- arg3 System.Int32
- arg4 System.Int32
- arg5 System.Int32
- arg6 System.Threading.CancellationToken
ResolveWireFormatTcp(System.String dnsServer, System.Int32 port, System.String name, DnsClientX.DnsRecordType type, System.Boolean requestDnsSec, System.Boolean validateDnsSec, System.Boolean debug, DnsClientX.Configuration endpointConfiguration, System.Threading.CancellationToken cancellationToken) #Sends a DNS query in wire format using DNS over TCP (53) and returns the response.
Parameters
- dnsServer System.String
- port System.Int32
- name System.String
- type DnsClientX.DnsRecordType
- requestDnsSec System.Boolean
- validateDnsSec System.Boolean
- debug System.Boolean
- endpointConfiguration DnsClientX.Configuration
- Provide configuration so it can be added to Question for display purposes
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
The DNS response.
Exceptions
ArgumentNullException
SendQueryOverTcp(System.Byte[] query, System.String dnsServer, System.Int32 port, System.Int32 timeoutMilliseconds, System.Threading.CancellationToken cancellationToken) #Sends a DNS query over TCP and returns the response.
Parameters
- query System.Byte[]
- dnsServer System.String
- port System.Int32
- timeoutMilliseconds System.Int32
- Timeout in milliseconds.
- cancellationToken System.Threading.CancellationToken
- Token used to cancel the operation.
Returns
Raw DNS response bytes.