how to get local dns server?

  • Thread starter Thread starter Garrard
  • Start date Start date
G

Garrard

I need to access a dns server directly. I need to query
the mx records, so System.Net.Dns has no methods
to offer for that. Any ideas how I get the ip address
for a local dns server.
(there must be a way, since System.Net.Dns would
have to do this internally as well)

Tia.
 
You can look up what DNS addresses a given network adapter on your device is
using pretty easily via the registry. Look in HKLM/Comm/<adaptername>1/.
Alternatively, you can use the IP Helper API to get information about the
adapter configuration, including DNS servers.

You might look at the OpenNETCF SDF for some IP Helper calls, although I
don't recall returning any DNS information in there. You may be able to use
them as a pattern or even suggest enhancements for OpenNETCF...

Paul T.
 
Back
Top