Re: Finding out how current DNS servers were set

From: Stig Sandnes (Sandnes_at_discussions.microsoft.com)
Date: 08/19/04


Date: Thu, 19 Aug 2004 01:33:02 -0700

Thank you very much for your answer - this was exactly what I was looking for!

The only situation your method will not work, is when both the
"DhcpNameServer" and the "NameServer" lists are equal (except for the
separators). In this (admittedly contrieved) case, it would not be possible
to find out whether the current DNS setting is static or DHCP.

"Jeroen van Bemmel" wrote:

> You can read it from the registry at
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\XXX
> where XXX is the GUID of a network adapter.
>
> If you find a "DhcpNameServer" there it is set through DHCP. The
> "NameServer" entry is statically set using the GUI
> Note that when the strings contain multiple entries, the separators used are
> different (one has spaces, one commas)
>
> You can enumerate all DNS servers through IPHelper and check them against
> these lists
>
> "Stig Sandnes" <Stig Sandnes@discussions.microsoft.com> wrote in message
> news:3C8661AD-970B-449B-A088-FE116AF24DFA@microsoft.com...
> >I would like to programmatically detect whether the current DNS servers
> > associated with an interface have been statically set or whether they are
> > dynamically controlled by a DHCP server?
> >
> > I cannot fiond any way to query this information with the IP Helper API or
> > with the WMI Win32_NetworkAdapterConfiguration class. However, I can
> > detect
> > it with the netsh utility (typing "show dns" in the "interface ip"
> > context),
> > but parsing the text output is not an attractive option.
> >
> > Any suggestions? Thank you.
>
>
>



Relevant Pages

  • Re: Finding out how current DNS servers were set
    ... If you find a "DhcpNameServer" there it is set through DHCP. ... "NameServer" entry is statically set using the GUI ... You can enumerate all DNS servers through IPHelper and check them against ... > dynamically controlled by a DHCP server? ...
    (microsoft.public.win32.programmer.networks)
  • DNS Lookup Problem
    ... I currently am able to run a secure tunnel from my work computer ... link provided that lists all restricted domains. ... connections to what I deem to be the DNS servers at work. ... Is there some setting in PuTTY that I can change so that DNS ...
    (comp.security.ssh)
  • Re: DNS dynamic update pending in DHCP
    ... Have you assigned a user account with a non-expiring password in the DHCP scope properties for the DHCP server to authenticate with the DNS server? ... > Al clients have a new ip address from the new DHCP server. ... only the internal DNS servers are to be used. ...
    (microsoft.public.windows.server.dns)
  • Re: Home PCs and DNS addresses
    ... workstations with a static IP address and the following DNS servers: ... I shut down the SBS. ... Ideally, I'd like the DHCP server in SBS to dole out it's address, and my ... ISP's addresses as DNS entries for all workstations on the local network. ...
    (microsoft.public.windows.server.sbs)
  • Re: Why does sys-unconfig want addresses for DNS servers when configuring DHCP?
    ... But when I run sys-unconfig to set up DHCP, the sys-unconfig program insists me telling it the IPs of the DNS servers. ... Is there a way to configure a Sun to use DHCP, and it get both the IP address, the default route and the addreses for the DNS servers from the DHCP server? ... LinkSys BEFSR-81 serves as both router and DHCP server. ...
    (comp.unix.solaris)