Introduction
editThe DNS packages cover both sides of the protocol, plus filtering:
| Package | Use it to |
|---|---|
Meziantou.Framework.DnsClient | Send queries to a DNS server and read typed records, with optional DNSSEC validation. See DnsClient. |
Meziantou.Framework.DnsServer | Answer DNS queries from your own code, in an ASP.NET Core application. See DnsServer. |
Meziantou.Framework.DnsFilter | Parse block lists (hosts files, domain lists, Adblock-style rules) and decide whether a domain is blocked, allowed or rewritten. See DnsFilter. |
Meziantou.DnsProxy | Run a DNS proxy that filters queries and forwards the others to upstream resolvers. It is a .NET tool built on the three libraries. See DnsProxy. |
Protocols
The client and the server support the same transports:
| Transport | DnsClientProtocol / DnsServerProtocol | Default port | Standard |
|---|---|---|---|
| UDP | Udp | 53 | RFC 1035 |
| TCP | Tcp | 53 | RFC 7766 |
| DNS over TLS (DoT) | Tls | 853 | RFC 7858 |
| DNS over HTTPS (DoH) | Https | 443 (the port of the URL) | RFC 8484 |
| DNS over QUIC (DoQ) | Quic | 853 | RFC 9250 |
DNS over QUIC needs QUIC support from the operating system (System.Net.Quic). Where it is missing, the client throws PlatformNotSupportedException and the server does not start its QUIC listeners. See Protocols.
Both sides also support EDNS(0) (larger UDP messages, the DNSSEC OK flag, extended response codes) and every common record type, from A and MX to SVCB, HTTPS and the DNSSEC records.
Requirements
Meziantou.Framework.DnsServerdepends on the ASP.NET Core shared framework (Microsoft.AspNetCore.App), which the .NET SDK provides, also in console and test projects.Meziantou.Framework.DnsClientandMeziantou.Framework.DnsFilterare compatible with trimming.Meziantou.DnsProxyneeds the ASP.NET Core runtime.
Next steps
- Getting started: send a query, and answer one.
- Limitations: what the packages do not do.