You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to use this library, as standard .NET DNS implementation doesn't return nice host name.
On iOS Simulator, below code returns fine:
var client = new LookupClient();
return await client.GetHostNameAsync(ip);
on device it throws error:
2022-01-20 14:45:45.395.iOS[1299:342331] System.ArgumentOutOfRangeException: List of configured name servers must not be empty.
Parameter name: servers
at DnsClient.LookupClient.QueryInternalAsync (DnsClient.DnsQuestion question, DnsClient.DnsQuerySettings queryOptions, System.Collections.Generic.IReadOnlyCollection`1[T] servers, System.Threading.CancellationToken cancellationToken) [0x00061] in <afd7bd4618b64f01ae1ddbabc84fd0e8>:0
at DnsClient.DnsQueryExtensions.GetHostNameAsync (DnsClient.IDnsQuery query, System.Net.IPAddress address) [0x0009f] in <afd7bd4618b64f01ae1ddbabc84fd0e8>:0
at <project>.DevicesDiscovery.Scanners.DnsHostNameResolver.GetHostNameWithDnsClientNet (System.Net.IPAddress ip) [0x0003a] in /Users/immons/Projects/<project>.DevicesDiscovery/Scanners/DnsScanner.cs:62
The text was updated successfully, but these errors were encountered:
The error might be slightly misleading. But this just means that the DNS server auto discovery didn't work.
Which is expected on iOS.
To get the DNS server(s) on mobile, you need to call some different APIs, and until .NET Core supports some way to get that information for you, you have to do that step yourself and initialize the client with the server(s) you found.
That being said, I'm not a mobile developer and especially not on iOS, so if there is some way to get DNS server information I'm happy to look at a PR
Trying to use this library, as standard .NET DNS implementation doesn't return nice host name.
On iOS Simulator, below code returns fine:
on device it throws error:
The text was updated successfully, but these errors were encountered: