Show / Hide Table of Contents

Class DotClient

Client to a DNS server over TLS.

Inheritance
Object
DnsClientBase
DotClient
Implements
IDnsClient
IDisposable
IResolver
Inherited Members
DnsClientBase.ThrowResponseError
DnsClientBase.NextQueryId()
DnsClientBase.ResolveAsync(DomainName, CancellationToken)
DnsClientBase.QueryAsync(DomainName, DnsType, CancellationToken)
DnsClientBase.SecureQueryAsync(DomainName, DnsType, CancellationToken)
DnsClientBase.ResolveAsync(IPAddress, CancellationToken)
DnsClientBase.Dispose()
DnsClientBase.ResolveAsync(Message, CancellationToken)
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: Makaretu.Dns
Assembly: Makaretu.Dns.Unicast.dll
Syntax
public class DotClient : DnsClientBase, IDnsClient, IDisposable, IResolver
Remarks

DNS over TLS is a security protocol for encrypting and wrapping DNS queries and answers via the Transport Layer Security (TLS) protocol. The goal is to increase user privacy and security by preventing eavesdropping and manipulation of DNS data via man-in-the-middle attacks.

All queries are padded to the closest multiple of BlockLength octets.

Fields

| Improve this Doc View Source

DefaultPort

The default port of a DOT server.

Declaration
public const int DefaultPort = 853
Field Value
Type Description
Int32
| Improve this Doc View Source

PublicServers

Known servers that support DNS over TLS.

Declaration
public static DotEndPoint[] PublicServers
Field Value
Type Description
DotEndPoint[]

Sequence of known servers.

Remarks

This is the default list that Servers uses.

Properties

| Improve this Doc View Source

BlockLength

The number of octets for padding.

Declaration
public int BlockLength { get; set; }
Property Value
Type Description
Int32

Defaults to 128.

Remarks

All queries are padded to the closest multiple of BlockLength octets.

See Also
https://tools.ietf.org/html/rfc8467#section-4.1
| Improve this Doc View Source

Servers

The DNS over TLS servers to communication with.

Declaration
public IEnumerable<DotEndPoint> Servers { get; set; }
Property Value
Type Description
IEnumerable<DotEndPoint>

A sequence of DOT endpoints. The default is the PublicServers.

| Improve this Doc View Source

Timeout

Time to wait for a DNS response.

Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type Description
TimeSpan

The default is 4 seconds.

Methods

| Improve this Doc View Source

Dispose(Boolean)

Dispose the client.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
Boolean disposing

true if managed resources should be disposed.

Overrides
DnsClientBase.Dispose(Boolean)
| Improve this Doc View Source

GetDnsServerAsync()

Get the stream to a DNS server.

Declaration
public Task<Stream> GetDnsServerAsync()
Returns
Type Description
Task<Stream>
| Improve this Doc View Source

QueryAsync(Message, CancellationToken)

Send a DNS query with the specified message.

Declaration
public override Task<Message> QueryAsync(Message request, CancellationToken cancel = default(CancellationToken))
Parameters
Type Name Description
Message request

A Message containing a Question.

CancellationToken cancel

Is used to stop the task. When cancelled, the TaskCanceledException is raised.

Returns
Type Description
Task<Message>

A task that represents the asynchronous operation. The task's value contains the response Message.

Overrides
DnsClientBase.QueryAsync(Message, CancellationToken)
Remarks

Sends the request and waits for the matching response.

Exceptions
Type Condition
IOException

When the DNS server returns error status or no response.

Implements

IDnsClient
System.IDisposable
IResolver

See Also

https://tools.ietf.org/html/rfc7858
https://tools.ietf.org/html/rfc8310
  • Improve this Doc
  • View Source
Back to top Generated by DocFX