# Use typed records in .NET

Use typed records in .NET on Evotec with practical examples, usage guidance, and reusable project workflows.

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.

[View on GitHub](https://github.com/EvotecIT/DnsClientX) [Visit Website](#) [Releases](https://github.com/EvotecIT/DnsClientX/releases) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/DnsClientX)

Stars**27**

Forks**3**

Open issues**0**

PowerShell Gallery downloads**93546**

Release**v2.3.1**

Language: C# Updated: 2026-11-23

Curated Examples

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

```csharp
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

- [DemoTypedRecords.cs](https://github.com/EvotecIT/DnsClientX/blob/master/DnsClientX.Examples/DemoTypedRecords.cs)

<!-- PowerForge markdown artifact sha256:903E4B75071E5B316AD9469B6DE070E56053DA0114FA5552F8C6839675BC19EB -->
