alexreinert/ARSoft.Tools.Net

ResolveAsync does not iterate through all servers

Closed this issue · 2 comments

Repro code below, check the comment for where it throws vs it doesn't.

List<IPAddress> lDnsServers = new List<IPAddress>();
lDnsServers.Add(IPAddress.Parse("1.4.5.6")); // non existent
lDnsServers.Add(IPAddress.Parse("8.8.8.8"));

DnsClient lClient = new DnsClient(lDnsServers, 5000);
lClient.IsTcpEnabled = true;
var resolver = new DnsStubResolver(lClient);
var records1 = resolver.Resolve<MxRecord>(lDomain, RecordType.Mx); // this will NOT throw and get the result from 8.8.8.8
var records2 = await resolver.ResolveAsync<MxRecord>(lDomain, RecordType.Mx).ConfigureAwait(false); // this will throw on the non existent server and never query 8.8.8.8

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.