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
  • 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 5 SDK installed. Just clone the repository and open the solution in Visual Studio 2019.

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

28 total downloads
13 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.0-beta-20240407.1 487.94 KB Sun, 07 Apr 2024 00:08:30 GMT 0
1.8.0-beta-20240320.1 491.53 KB Wed, 20 Mar 2024 15:15:48 GMT 0
1.8.0-beta-20240318.2 487.98 KB Mon, 18 Mar 2024 12:23:05 GMT 1
1.8.0-beta-20240318.1 487.98 KB Mon, 18 Mar 2024 12:17:53 GMT 1
1.8.0-beta-20240317.9 488.39 KB Sun, 17 Mar 2024 16:35:17 GMT 1
1.8.0-beta-20240317.7 488.19 KB Sun, 17 Mar 2024 16:23:01 GMT 1
1.8.0-beta-20240317.6 488.18 KB Sun, 17 Mar 2024 16:13:08 GMT 0
1.8.0-beta-20240317.5 488.16 KB Sun, 17 Mar 2024 14:55:17 GMT 0
1.8.0-beta-20240317.4 488.18 KB Sun, 17 Mar 2024 14:48:26 GMT 0
1.8.0-beta-20240317.3 403.13 KB Sun, 17 Mar 2024 14:14:46 GMT 1
1.8.0-beta-20240317.2 399.5 KB Sun, 17 Mar 2024 13:51:19 GMT 1
1.8.0-beta-20240317.1 399.5 KB Sun, 17 Mar 2024 13:43:16 GMT 1
1.8.0-beta-20240311.3 398.9 KB Mon, 11 Mar 2024 13:49:50 GMT 1
1.8.0-beta-20240311.2 398.89 KB Mon, 11 Mar 2024 02:46:22 GMT 0
1.8.0-beta-20240311.1 399.09 KB Mon, 11 Mar 2024 01:03:25 GMT 0
1.8.0-beta-20240310.6 399.05 KB Sun, 10 Mar 2024 22:13:54 GMT 0
1.8.0-beta-20240310.5 398.74 KB Sun, 10 Mar 2024 19:50:35 GMT 1
1.8.0-beta-20240310.4 398.79 KB Sun, 10 Mar 2024 19:44:07 GMT 0
1.8.0-beta-20240310.3 401.71 KB Sun, 10 Mar 2024 14:30:35 GMT 1
1.8.0-beta-20240310.2 398.81 KB Sun, 10 Mar 2024 14:15:29 GMT 0
1.7.0 655.97 KB Sun, 23 Oct 2022 13:56:07 GMT 0
1.6.1 562.91 KB Fri, 10 Jun 2022 20:40:15 GMT 0
1.6.0 562.82 KB Sun, 30 Jan 2022 20:09:45 GMT 3
1.5.0 562.65 KB Sun, 20 Jun 2021 18:18:40 GMT 0
1.4.0 438.48 KB Sat, 12 Jun 2021 17:07:11 GMT 2
1.0.7 117.46 KB Mon, 01 May 2017 16:09:37 GMT 13