Ubiety.Dns.Core

A reusable DNS resolver for .NET. It builds DNS queries, sends them over UDP or TCP, and parses the replies into typed record objects.

var resolver = ResolverBuilder.Begin()
    .AddDnsServer("1.1.1.1")
    .UseRecursion()
    .EnableCache()
    .Build();

var response = await resolver.QueryAsync("example.com", QuestionType.A);

foreach (var record in response.GetRecords<RecordA>())
{
    Console.WriteLine(record.Address);
}

Thank you to the initial work of Alphons van der Heijden and Geoffry Huntley on this library.