Introduction

edit

The DNS packages cover both sides of the protocol, plus filtering:

PackageUse it to
Meziantou.Framework.DnsClientSend queries to a DNS server and read typed records, with optional DNSSEC validation. See DnsClient.
Meziantou.Framework.DnsServerAnswer DNS queries from your own code, in an ASP.NET Core application. See DnsServer.
Meziantou.Framework.DnsFilterParse block lists (hosts files, domain lists, Adblock-style rules) and decide whether a domain is blocked, allowed or rewritten. See DnsFilter.
Meziantou.DnsProxyRun 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:

TransportDnsClientProtocol / DnsServerProtocolDefault portStandard
UDPUdp53RFC 1035
TCPTcp53RFC 7766
DNS over TLS (DoT)Tls853RFC 7858
DNS over HTTPS (DoH)Https443 (the port of the URL)RFC 8484
DNS over QUIC (DoQ)Quic853RFC 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.DnsServer depends on the ASP.NET Core shared framework (Microsoft.AspNetCore.App), which the .NET SDK provides, also in console and test projects.
  • Meziantou.Framework.DnsClient and Meziantou.Framework.DnsFilter are compatible with trimming.
  • Meziantou.DnsProxy needs the ASP.NET Core runtime.

Next steps