DnsClient 1.8.0-beta-20240317.9

Prefix Reserved
This is a prerelease version of DnsClient.
There is a newer version of this package available.
See the version list below for details.
dotnet add package DnsClient --version 1.8.0-beta-20240317.9                
NuGet\Install-Package DnsClient -Version 1.8.0-beta-20240317.9                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DnsClient" Version="1.8.0-beta-20240317.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DnsClient --version 1.8.0-beta-20240317.9                
#r "nuget: DnsClient, 1.8.0-beta-20240317.9"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DnsClient as a Cake Addin
#addin nuget:?package=DnsClient&version=1.8.0-beta-20240317.9&prerelease

// Install DnsClient as a Cake Tool
#tool nuget:?package=DnsClient&version=1.8.0-beta-20240317.9&prerelease                


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.


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;



  • 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

  • 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.


Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  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 is compatible.  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. 
.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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (132)

Showing the top 5 NuGet packages that depend on DnsClient:

Package Downloads

Core Component of the Official MongoDB .NET Driver.


Microsoft.Extensions.Configuration.AzureAppConfiguration is a configuration provider for the .NET Core framework that allows developers to use Microsoft Azure App Configuration service as a configuration source in their applications.


The Official Couchbase .NET SDK.


(Unofficial) Signed Core Component of the MongoDB .NET Driver. The containing assembly was generated by signing the officially published MongoDB.Driver.Core.dll.


Application Component for the Alliance Business Suite.

GitHub repositories (50)

Showing the top 5 popular GitHub repositories that depend on DnsClient:

Repository Stars
🛠「Watt Toolkit」是一个开源跨平台的多功能 Steam 工具箱。
Bitwarden infrastructure/backend (API, database, Docker, etc).
A powerful tool for managing networks and troubleshoot network problems!
Thoughtfully architected, obscenely fast, thoroughly enjoyable web services for all
Version Downloads Last updated
1.8.0 18,575 7/1/2024
1.8.0-beta-20240317.9 2,527 3/17/2024
1.7.0 6,587,266 10/23/2022
1.6.1 49,213,773 6/10/2022
1.6.0 10,032,183 1/30/2022
1.5.0 3,965,827 6/20/2021
1.5.0-beta-20210612.7 1,443 6/12/2021
1.5.0-beta-20210522.7 629 5/22/2021
1.4.0 37,581,151 2/14/2021
1.4.0-beta-20200912.4 17,255 9/12/2020
1.4.0-beta-20200801.7 69,873 8/1/2020
1.3.2 4,739,539 5/13/2020
1.3.2-beta-20200512.2 479 5/12/2020
1.3.1 34,920,156 3/31/2020
1.3.0 354,839 3/17/2020
1.3.0-beta-20200316.3 745 3/16/2020
1.3.0-beta-20200314.3 620 3/14/2020
1.3.0-beta-20200311.4 1,199 3/11/2020
1.2.0 37,465,291 8/15/2018
1.1.1 359,683 6/13/2018
1.1.0 19,721 6/4/2018
1.0.7 17,968,412 5/1/2017
1.0.6 18,330 4/5/2017
1.0.5 14,334 3/3/2017
1.0.4 3,545 2/23/2017
1.0.3 19,701 1/21/2017
1.0.2 3,509 1/16/2017
1.0.2-beta-1080 3,109 1/10/2017
1.0.1 50,270 12/31/2016
1.0.1-beta-1033 3,083 12/31/2016
1.0.1-beta-1030 3,192 12/31/2016
1.0.0 5,675 12/29/2016
1.0.0-beta-1017 3,449 12/7/2016
1.0.0-beta-1014 3,372 11/27/2016
1.0.0-beta-1011 3,316 11/24/2016
1.0.0-beta-1005 3,271 11/22/2016