This is one way (but only in .NET 2.0):
<code>
using System.Net.NetworkInformation
....
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface ni in nics)
{
if (ni.OperationalStatus == OperationalStatus.Up)
{
IPAddressCollection ips = ni.GetIPProperties().DnsAddresses;
foreach (System.Net.IPAddress ip in ips)
{
MessageBox.Show(ip.ToString());
}
}
}
</code>
"Morgan Cheng" wrote:
In windows, Dns.GetHostEntry invocation on a non-existent domain cost
time (about 25 seconds in my machine). So, I decide to implement my
own DNS resolution with UDP packet transfer.
One problem is that, how to get DNS server IP config for current
machine?
Thanks