dnsclient - DnsClient 1.0.7

DnsClient.NET is a simple yet very powerful and high performant open source library for the .NET Framework to do DNS lookups

PM> Install-Package DnsClient -Version 1.0.7 -Source https://www.myget.org/F/dnsclient/api/v3/index.json

Copy to clipboard

> nuget.exe install DnsClient -Version 1.0.7 -Source https://www.myget.org/F/dnsclient/api/v3/index.json

Copy to clipboard

> dotnet add package DnsClient --version 1.0.7 --source https://www.myget.org/F/dnsclient/api/v3/index.json

Copy to clipboard
<PackageReference Include="DnsClient" Version="1.0.7" />
Copy to clipboard
source https://www.myget.org/F/dnsclient/api/v3/index.json

nuget DnsClient  ~> 1.0.7
Copy to clipboard

> choco install DnsClient --version 1.0.7 --source https://www.myget.org/F/dnsclient/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "dnsclient" -SourceLocation "https://www.myget.org/F/dnsclient/api/v2"
Install-Module -Name "DnsClient" -RequiredVersion "1.0.7" -Repository "dnsclient" 
Copy to clipboard

DnsClient.NET

Build Status Code Coverage NuGet NuGet

DnsClient.NET is a simple yet very powerful and high performance open source library for the .NET Framework to do DNS lookups.

Usage

See the DnsClient site for more details and documentation.

The following example instantiates a new LookupClient to query some IP address.


var lookup = new LookupClient();
var result = await lookup.QueryAsync("google.com", QueryType.A);

var record = result.Answers.ARecords().FirstOrDefault();
var ip = record?.Address;

Features

General

  • Sync & Async API
  • UDP and TCP lookup, configurable if TCP should be used as fallback in case the UDP result is truncated (default=true).
  • Configurable EDNS support to change the default UDP buffer size and request security relevant records
  • Caching
    • Query result cache based on provided TTL
    • Minimum TTL setting to overrule the result's TTL and always cache the responses for at least that time. (Even very low value, like a few milliseconds, do make a huge difference if used in high traffic low latency scenarios)
    • Maximum TTL to limit cache duration
    • Cache can be disabled
  • Nameserver auto discovery. If no servers are explicitly configured, DnsClient will try its best to resolve them based on your local system configuration. This includes DNS servers configured via network interfaces or even via Windows specific NRPT policies.
  • Multiple DNS endpoints can be configured. DnsClient will use them in random or sequential order (configurable), with re-tries.
  • Configurable retry of queries
  • Optional audit trail of each response and exception
  • Configurable error handling. Throwing DNS errors, like NotExistentDomain is turned off by default
  • Optional Trace/Logging

Supported resource records

  • A, AAAA, NS, CNAME, SOA, MB, MG, MR, WKS, HINFO, MINFO, MX, RP, TXT, AFSDB, URI, CAA, NULL, SSHFP, TLSA, RRSIG, NSEC, NSEC3, NSEC3PARAM, DNSKEY, DS, NAPTR, CERT
  • PTR for reverse lookups
  • SRV for service discovery. LookupClient has some extensions to help with that.
  • AXFR zone transfer (as per spec, LookupClient has to be set to TCP mode only for this type. Also, the result depends on if the DNS server trusts your current connection)

Build from Source

To build and contribute to this project, you must have the latest .NET SDKs and Visual Studio 2022 installed.

Examples

  • .NETFramework 4.5
    • System.Buffers (>= 4.3.0)
  • .NETStandard 1.3
    • Microsoft.Win32.Primitives (>= 4.3.0)
    • NETStandard.Library (>= 1.6.1)
    • System.Buffers (>= 4.3.0)
    • System.Collections (>= 4.3.0)
    • System.Collections.Concurrent (>= 4.3.0)
    • System.Globalization.Extensions (>= 4.3.0)
    • System.IO.FileSystem (>= 4.3.0)
    • System.Linq (>= 4.3.0)
    • System.Net.NameResolution (>= 4.3.0)
    • System.Net.NetworkInformation (>= 4.3.0)
    • System.Net.Sockets (>= 4.3.0)
    • System.Runtime.Extensions (>= 4.3.0)
    • System.Runtime.InteropServices (>= 4.3.0)
    • System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
    • System.Text.Encoding (>= 4.3.0)
    • System.Threading (>= 4.3.0)
  • .NETFramework 4.5: 4.5.0.0
  • .NETStandard 1.3: 1.3.0.0

Owners

MichaCo

Authors

MichaCo

Project URL

https://github.com/MichaCo/DnsClient.NET

License

Apache-2.0

Tags

DNS Name Server CSharp .NET .NET Core

Info

1769 total downloads
92 downloads for version 1.0.7
Download (117.46 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.8.1-beta-20251030.4 499.4 KB Thu, 30 Oct 2025 15:15:50 GMT 15
1.8.1-beta-20251030.3 499.38 KB Thu, 30 Oct 2025 14:53:40 GMT 13
1.8.1-beta-20251030.2 500.05 KB Thu, 30 Oct 2025 14:15:58 GMT 20
1.8.0 490.08 KB Mon, 01 Jul 2024 12:29:27 GMT 78
1.8.0-beta-20240924.3 492.02 KB Tue, 24 Sep 2024 21:02:35 GMT 59
1.8.0-beta-20240924.2 492.05 KB Tue, 24 Sep 2024 14:38:09 GMT 71
1.8.0-beta-20240701.6 490.25 KB Mon, 01 Jul 2024 12:24:15 GMT 73
1.8.0-beta-20240701.5 490.29 KB Mon, 01 Jul 2024 12:19:15 GMT 71
1.8.0-beta-20240630.5 491.8 KB Sun, 30 Jun 2024 19:45:07 GMT 65
1.8.0-beta-20240630.4 488.17 KB Sun, 30 Jun 2024 19:36:14 GMT 67
1.8.0-beta-20240630.3 488.19 KB Sun, 30 Jun 2024 19:29:53 GMT 62
1.8.0-beta-20240630.2 488.19 KB Sun, 30 Jun 2024 19:22:14 GMT 69
1.8.0-beta-20240630.1 491.52 KB Sun, 30 Jun 2024 19:12:03 GMT 74
1.8.0-beta-20240407.1 487.94 KB Sun, 07 Apr 2024 00:08:30 GMT 67
1.8.0-beta-20240320.1 491.53 KB Wed, 20 Mar 2024 15:15:48 GMT 73
1.8.0-beta-20240318.2 487.98 KB Mon, 18 Mar 2024 12:23:05 GMT 62
1.8.0-beta-20240318.1 487.98 KB Mon, 18 Mar 2024 12:17:53 GMT 78
1.8.0-beta-20240317.9 488.39 KB Sun, 17 Mar 2024 16:35:17 GMT 82
1.8.0-beta-20240317.7 488.19 KB Sun, 17 Mar 2024 16:23:01 GMT 78
1.8.0-beta-20240317.6 488.18 KB Sun, 17 Mar 2024 16:13:08 GMT 75
1.8.0-beta-20240317.5 488.16 KB Sun, 17 Mar 2024 14:55:17 GMT 70
1.7.0 655.97 KB Sun, 23 Oct 2022 13:56:07 GMT 63
1.6.1 562.91 KB Fri, 10 Jun 2022 20:40:15 GMT 62
1.6.0 562.82 KB Sun, 30 Jan 2022 20:09:45 GMT 85
1.5.0 562.65 KB Sun, 20 Jun 2021 18:18:40 GMT 82
1.4.0 438.48 KB Sat, 12 Jun 2021 17:07:11 GMT 63
1.0.7 117.46 KB Mon, 01 May 2017 16:09:37 GMT 92