Meziantou.Framework.DnsClient 2.0.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Meziantou.Framework.DnsClient --version 2.0.0
                    
NuGet\Install-Package Meziantou.Framework.DnsClient -Version 2.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meziantou.Framework.DnsClient" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.DnsClient" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Meziantou.Framework.DnsClient" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Meziantou.Framework.DnsClient --version 2.0.0
                    
#r "nuget: Meziantou.Framework.DnsClient, 2.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Meziantou.Framework.DnsClient@2.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Meziantou.Framework.DnsClient&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Meziantou.Framework.DnsClient&version=2.0.0
                    
Install as a Cake Tool

Meziantou.Framework.DnsClient

A comprehensive DNS client library supporting multiple transport protocols, all standard DNS record types, DNSSEC, EDNS(0), internationalized domain names, and reverse DNS lookups.

Features

  • Multiple protocols: UDP, TCP, DNS over TLS (DoT), DNS over HTTPS (DoH), DNS over QUIC (DoQ)
  • All DNS record types: A, AAAA, MX, TXT, CNAME, NS, SOA, SRV, PTR, CAA, NAPTR, SVCB, HTTPS, and more
  • DNSSEC support: Request and parse DNSKEY, DS, RRSIG, NSEC, NSEC3 records
  • EDNS(0): Configurable UDP payload size, DNSSEC OK flag, extended RCODE
  • IDN/Punycode: Automatic Unicode to punycode conversion for internationalized domain names
  • Reverse DNS: Helper for PTR lookups on IPv4 and IPv6 addresses
  • OpenTelemetry: Built-in ActivitySource tracing for DNS queries

Usage

using Meziantou.Framework.DnsClient;
using Meziantou.Framework.DnsClient.Query;

// Simple query using DNS over HTTPS
using var client = new DnsClient("https://cloudflare-dns.com/dns-query", DnsClientProtocol.Https);
var response = await client.QueryAsync("example.com", DnsQueryType.A);

foreach (var record in response.Answers.OfType<Response.Records.DnsARecord>())
{
    Console.WriteLine(record.Address);
}

DNS over TLS

using var client = new DnsClient("1.1.1.1", DnsClientProtocol.Tls);
var response = await client.QueryAsync("example.com", DnsQueryType.AAAA);

Reverse DNS lookup

using var client = new DnsClient("https://cloudflare-dns.com/dns-query", DnsClientProtocol.Https);
var response = await client.ReverseLookupAsync(IPAddress.Parse("1.1.1.1"));

foreach (var ptr in response.Answers.OfType<Response.Records.DnsPtrRecord>())
{
    Console.WriteLine(ptr.DomainName);
}

Internationalized domain names

using var client = new DnsClient("https://cloudflare-dns.com/dns-query", DnsClientProtocol.Https);
// Unicode domain names are automatically converted to punycode
var response = await client.QueryAsync("münchen.de", DnsQueryType.A);

DNSSEC

using var client = new DnsClient("https://cloudflare-dns.com/dns-query", DnsClientProtocol.Https,
    new DnsClientOptions { DnssecValidationMode = DnssecValidationMode.Local });

var response = await client.QueryAsync("cloudflare.com", DnsQueryType.A);
Console.WriteLine($"Local DNSSEC validation: {response.DnssecValidationResult.Status}");

DnsResponseHeader.AuthenticatedData exposes the upstream resolver's AD flag. Use DnssecValidationMode.Local when the client must validate the DNSSEC chain locally.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.9 56 11/13/2026
2.0.8 94 11/8/2026
2.0.7 117 10/31/2026
2.0.6 161 10/21/2026
2.0.5 106 10/16/2026
2.0.4 126 9/11/2026
2.0.3 134 9/6/2026
2.0.2 131 8/16/2026
2.0.1 136 7/8/2026
2.0.0 151 7/5/2026
1.0.5 153 7/5/2026
1.0.4 146 6/28/2026
1.0.3 142 6/13/2026
1.0.2 335 5/31/2026
1.0.1 147 5/14/2026
1.0.0 159 3/24/2026