DnsClient.NET is a simple yet very powerful and high performance open source library for the .NET Framework to do DNS lookups
$ dotnet add package DnsClientDnsClient.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;
NotExistentDomain is turned off by defaultLookupClient has some extensions to help with that.To build and contribute to this project, you must have the latest .NET SDKs and Visual Studio 2022 installed.