Reputation: 495
Folling all the examples I can find, tried various ways and also read about something that may need Task but kind of stuck. Anything I do I get a DNS cant resolve error or the result is null.
public static void LookupDns()
{
var res = ArLookup("google.com");
}
public static Task<List<ARecord>> ArLookup(string domain)
{
var resolver = new DnsStubResolver();
return resolver.ResolveAsync<ARecord>(domain, RecordType.A);
}
Anyone help me out on this? What am I doing wrong? I can do the simple Microsoft.Net
IPHostEntry hostInfo = Dns.GetHostEntry("www.contoso.com");
so I know that works.
Upvotes: 0
Views: 284
Reputation: 495
When using my VPN PIA Internet it would not resolve. Wasted 6 hours tracking that down.
Upvotes: 0