DnsServerOptions Class
Configures the DNS server listeners.
public sealed class DnsServerOptionsConstructors
| Name | Description |
|---|---|
| DnsServerOptions() |
DnsServerOptions()
DnsServerOptions.cspublic DnsServerOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| MaxConcurrentQueriesPerConnection | Gets or sets how many queries a single connection may have in flight at once. Defaults to 16. |
| MaxUdpResponseSize | Gets or sets the largest UDP response the server will send, in bytes. A client's advertised EDNS payload size is clamped to this value; larger answers are truncated so the client retries over TCP. Defaults to 1232 bytes, the size recommended by DNS Flag Day 2020, which also limits how much a spoofed query can amplify. |
| QuicIdleTimeout | Gets or sets how long a DNS over QUIC connection may stay idle before it is closed. Defaults to 30 seconds. |
| TcpIdleTimeout | Gets or sets how long a TCP or DNS over TLS connection may sit without a complete query before the server closes it (RFC 7766 6.2.3). Defaults to 30 seconds. Use Timeout.InfiniteTimeSpan to disable, at the cost of letting idle connections accumulate. |
MaxConcurrentQueriesPerConnection
DnsServerOptions.csMaxUdpResponseSize
DnsServerOptions.csGets or sets the largest UDP response the server will send, in bytes. A client's advertised EDNS payload size is clamped to this value; larger answers are truncated so the client retries over TCP. Defaults to 1232 bytes, the size recommended by DNS Flag Day 2020, which also limits how much a spoofed query can amplify.
public int MaxUdpResponseSize { get; set; }Property value
QuicIdleTimeout
DnsServerOptions.csTcpIdleTimeout
DnsServerOptions.csGets or sets how long a TCP or DNS over TLS connection may sit without a complete query before the server closes it (RFC 7766 6.2.3). Defaults to 30 seconds. Use Timeout.InfiniteTimeSpan to disable, at the cost of letting idle connections accumulate.
public TimeSpan TcpIdleTimeout { get; set; }Property value
Methods
| Name | Description |
|---|---|
| AddQuicListener(int, X509Certificate2, IPAddress?) | Adds a DNS over QUIC listener on the specified port. |
| AddTcpListener(int, IPAddress?) | Adds a TCP listener on the specified port. |
| AddTlsListener(int, X509Certificate2, IPAddress?) | Adds a DNS over TLS listener on the specified port. |
| AddUdpListener(int, IPAddress?) | Adds a UDP listener on the specified port. |
AddQuicListener(int, X509Certificate2, IPAddress?)
DnsServerOptions.csAdds a DNS over QUIC listener on the specified port.
public DnsServerOptions AddQuicListener(int port, X509Certificate2 certificate, IPAddress? bindAddress = null)AddTcpListener(int, IPAddress?)
DnsServerOptions.csAdds a TCP listener on the specified port.
public DnsServerOptions AddTcpListener(int port = 53, IPAddress? bindAddress = null)AddTlsListener(int, X509Certificate2, IPAddress?)
DnsServerOptions.csAdds a DNS over TLS listener on the specified port.
public DnsServerOptions AddTlsListener(int port, X509Certificate2 certificate, IPAddress? bindAddress = null)AddUdpListener(int, IPAddress?)
DnsServerOptions.csAdds a UDP listener on the specified port.
public DnsServerOptions AddUdpListener(int port = 53, IPAddress? bindAddress = null)