Project

DnsClientX

DnsClientX is an async C# library for DNS over UDP, TCP, HTTPS (DoH), and TLS (DoT). It also has a PowerShell module that can be used to query DNS records. It provides a simple way to query DNS records using multiple DNS providers. It supports multiple DNS record types and parallel queries.

Stars22
Forks3
Open issues1
PowerShell Gallery downloads48624
Releasev1.0.7
Language: C# Updated: 2026-04-09T13:58:43.0000000+00:00

Curated Examples

Use typed records in .NET

Read DNS query results as typed .NET record objects.

This pattern is useful when application code needs structured DNS data instead of raw strings.

It is adapted from DnsClientX.Examples/DemoTypedRecords.cs.

Example

using DnsClientX;

using var client = new ClientX(DnsEndpoint.Cloudflare);
var response = await client.Resolve("example.com", DnsRecordType.A, typedRecords: true);

foreach (var record in response.TypedAnswers ?? [])
{
    Console.WriteLine(record);
}

What this demonstrates

  • using the .NET client directly
  • enabling typed records for safer downstream processing
  • keeping the example independent of private zones

Source