Endeavoury.DNS.Client
1.0.10
dotnet add package Endeavoury.DNS.Client --version 1.0.10
NuGet\Install-Package Endeavoury.DNS.Client -Version 1.0.10
<PackageReference Include="Endeavoury.DNS.Client" Version="1.0.10" />
<PackageVersion Include="Endeavoury.DNS.Client" Version="1.0.10" />
<PackageReference Include="Endeavoury.DNS.Client" />
paket add Endeavoury.DNS.Client --version 1.0.10
#r "nuget: Endeavoury.DNS.Client, 1.0.10"
#:package Endeavoury.DNS.Client@1.0.10
#addin nuget:?package=Endeavoury.DNS.Client&version=1.0.10
#tool nuget:?package=Endeavoury.DNS.Client&version=1.0.10
DNS.Client
DNS.Client is a dependency-free, wire-compatible DNS resolver library for .NET.
It implements the client-side protocol described by RFC 1035,
with a modern high-level API for application lookups and a low-level API for protocol work.
Why this package?
- Works on runtimes implementing .NET Standard 2.0 or 2.1.
- Uses UDP by default, retries across resolvers, and falls back to TCP for truncated responses.
- Preserves unknown record types as raw RDATA instead of discarding bytes.
- Supports synchronous and asynchronous APIs, cancellation, timeouts, AXFR, and reverse DNS.
- Includes a TTL-aware
LookupClientcache and typed record collection helpers. - Has no third-party runtime dependencies.
Install
dotnet add package Endeavoury.DNS.Client
A first lookup
using System.Net;
using DNS.Client;
var lookup = new LookupClient();
var response = await lookup.QueryAsync("example.com", QuestionType.A);
foreach (var address in response.Answers.ARecords())
Console.WriteLine(address.Address);
For deterministic infrastructure or tests, specify resolvers explicitly:
var lookup = new LookupClient(new LookupClientOptions
{
NameServers = new[] { new NameServer(IPAddress.Parse("1.1.1.1")) },
Timeout = TimeSpan.FromSeconds(2),
Retries = 3,
EnableCache = true
});
Capabilities at a glance
| Area | Included |
|---|---|
| Queries | A, AAAA, NS, CNAME, MX, PTR, SOA, TXT, SRV, NAPTR, CAA, HINFO, MINFO, WKS and more |
| Transport | UDP, TCP framing, truncation fallback, retries, cancellation |
| Message format | Header flags, all four sections, name compression, pointer-loop protection |
| Resolver features | Server discovery, multiple endpoints, TTL cache, reverse lookup, AXFR |
| Extensibility | Unknown QTYPE/CLASS and RDATA are retained losslessly |
| Tooling | .NET Standard 2.0/2.1 library, tests, console sample, GitHub Actions releases |
Choose the right API
| Need | API |
|---|---|
| Normal application lookup | LookupClient.QueryAsync |
| A specific resolver/port | LookupClientOptions.NameServers or DnsClient(IPEndPoint[]) |
| Custom opcode, sections, or raw records | DnsMessage + DnsMessageCodec |
| Zone transfer | TransferZoneAsync |
| Inspect every byte | DnsMessage.Parse / DnsMessage.ToArray |
Documentation
- Usage guide — queries, options, records, cancellation, and examples.
- DNS fundamentals — names, records, recursion, caching, and transport.
- Technical architecture — wire codec, resolver pipeline, and failure handling.
- Record reference — supported types, models, and unknown-record behavior.
- API reference — public types and recommended usage patterns.
- Troubleshooting — timeouts, truncation, NXDOMAIN, and package diagnostics.
- Contributing — local development, tests, style, and pull requests.
- Publishing — semantic versions, GitHub Releases, and Trusted Publishing.
Coverage and RFC compliance
Every CI build runs the complete test suite with Coverlet and publishes a Cobertura
coverage artifact. Open the CI workflow,
select a successful run, and download code-coverage-* to inspect line and branch
coverage. Coverage is measured from the DNS.Client assembly only; tests and generated
code are excluded. A numeric badge will be added once a stable coverage service is
configured for this repository.
RFC status is tracked explicitly in the RFC compliance matrix.
The current implementation is a hardened unicast stub resolver: classic DNS message
encoding/decoding, unknown-record round trips, UDP/TCP fallback, retries, AXFR, and
modern core record models are covered. EDNS, DNSSEC validation, encrypted transports,
SVCB/HTTPS, mDNS, dynamic update, and other optional ecosystems remain marked
MISSING or NOT_APPLICABLE until implemented and tested.
Project layout
DNS.Client/ Library source
DNS.Client.Tests/ Protocol and transport tests
DNS.Client.Console/ Small command-line example
docs/ Developer and protocol documentation
.github/workflows/ Build, test, release, and package publishing
Compatibility and security
The library targets .NET Standard 2.0 and 2.1 and does not execute code received from DNS servers. DNS answers are untrusted input: validate names and record content before using them in security-sensitive decisions. Classic DNS provides no confidentiality or authenticity; use a trusted transport or DNSSEC-aware infrastructure when those properties are required.
License
Released under the MIT License.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- System.Memory (>= 4.5.5)
-
.NETStandard 2.1
- 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.