IsDnsEnabled

  • Thread starter Thread starter jve91
  • Start date Start date
J

jve91

We just moved to .NET 2.0, and in trying out
System.Net.NetworkInformation and friends, I find that it always says
IsDnsEnabled=false, even when that connection clearly is using DNS to
resolve names, I can fetch back DNS server addresses, etc. Anyone else
see this? All of the other settings look correct.

I was also *very* disappointed to find that NetworkInformation only
gave read access to network settings. To make changes I have to
continue using that abominable WMI. Which causes me even more grief by
behaving differently on Win2K than on XP. Is there any chance that
there is something for this in 2.0 and I'm just missing it?

(Yeah, I know, "Welcome to 3 years ago". Hey, large companies move
slowly.)
 
I doubt this helps, but...

I get the same result as you (IsDnsEnable=False).

I don't pretend to understand networking however, other than if I can hit a
site, things are good, else, things are bad. Therefore, I don't understand
the statement in the documentation that says the following: "Gets a Boolean
value that indicates whether NetBt is configured to use DNS name resolution
 
NetBt is NetBios Over Tcp. The IsDnsEnabled flag indicates whether or
not the NetBios protocol will attempt to use DNS to resolve NetBios
names. It has nothing to do with TCP using DNS to resolve names.
 
Interesting. Let's set aside Netbios for a moment, and IsDnsEnabled
along with it. Is there any way to tell whether DNS is enabled for
name resolution on an interface? Is it just always enabled, and it's a
matter of setting the suffix and DNS server(s) correctly? I have
always wondered why in the WMI world Win32_NetworkAdapterConfiguration
has a method EnableDNS() (which "enables DNS for service" and does not
mention NetBios) but does not have a DisableDNS() method. Maybe it's
not possible to disable it, and all EnableDNS() was ever really doing
is altering suffix/domain/search order/DNS-hostname? (so I suppose you
could "disable" it by setting the DNS servers to empty string) Hmm, I
don't see how I can obtain DNS-hostname (which can be different from
the NetBios system name) via System.Net.NetworkInformation - or maybe
I mean that the other way around.
 
Jeff said:
Interesting. Let's set aside Netbios for a moment, and IsDnsEnabled
along with it. Is there any way to tell whether DNS is enabled for
name resolution on an interface?

You could query the interface to see if there are configured DNS servers
(http://codeka.com/blogs/index.php/dean/2006/01/30/querying_the_list_of_configured_dns_serv
seems like a starting point), but that doesn't guarantee you'd fail to resolve
an address if there are none (because you can edit the hosts file and add
entries). Additionally, you can't guarantee that having DNS servers configured
means they're reachable.

DNS is generally "always on" and it appearing to be disabled is generally a lack
of configured DNS servers and/or an absentee authoritative server for whichever
domain name you are attempting to reach. Note, that's the general case, but it
can be changed.

What exactly are you trying to accomplish by checking to see if DNS is enabled?

Chris.
 
Back
Top