How to determine current DNS server IP number? 
Author Message
 How to determine current DNS server IP number?

Does anybody know how to find out the current DNS servers when using dynamic
(DHCP) Nameservers on dial up?
I have no problem to read the DSN server IP('s) from the registry when they
are fixed. But how do i obtain the info when DNS servers are given
dynamically via DHCP or on PPP dial up?

Example: I dial up to my ISP, PPP negotiotes my IP number and DNS servers.
How can my program find out the DNS numbers obtained?

Alreday known/discoverd:
- winipcfg.exe can do write the information to a file, but it is a bit
akward  and very slow to shell out to a .exe and then read the results from
a file.
- there is a ipcfgdll.dll in Windows 98 that appears to be a dll version of
winipcfg.exe.Ipcfgdll.dll exports functions that appear to do the job, but
the dll is not documented. Anybody knows the function syntax for the exports
of ipcfgdll.dll ?

Thanks

Peter



Sat, 30 Mar 2002 03:00:00 GMT  
 How to determine current DNS server IP number?

Peter,

Found this in MSDN, hope it helps.

When a client accepts an IP address, and any other configuration information
offered by the DHCP server, the client saves the configuration in the
following Registry keys:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services: Network interface
specific: <adapter>\parameters\Tcpip General: Dhcp\parameters\options\*
IP addressing information is leased to a client until the client manually
releases the address, or until the DHCP server cancels the lease and makes
the address available to other computers on the network.

Quote:

>Does anybody know how to find out the current DNS servers when using
dynamic
>(DHCP) Nameservers on dial up?
>I have no problem to read the DSN server IP('s) from the registry when they
>are fixed. But how do i obtain the info when DNS servers are given
>dynamically via DHCP or on PPP dial up?

>Example: I dial up to my ISP, PPP negotiotes my IP number and DNS servers.
>How can my program find out the DNS numbers obtained?

>Alreday known/discoverd:
>- winipcfg.exe can do write the information to a file, but it is a bit
>akward  and very slow to shell out to a .exe and then read the results from
>a file.
>- there is a ipcfgdll.dll in Windows 98 that appears to be a dll version of
>winipcfg.exe.Ipcfgdll.dll exports functions that appear to do the job, but
>the dll is not documented. Anybody knows the function syntax for the
exports
>of ipcfgdll.dll ?

>Thanks

>Peter



Sat, 30 Mar 2002 03:00:00 GMT  
 How to determine current DNS server IP number?
More discovered:

In win98 there is some info in:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\DHCP\DhcpInfo

The current IP number is found here, but not the DNS server number(s).



Sun, 31 Mar 2002 03:00:00 GMT  
 How to determine current DNS server IP number?

Tony,

Thanks for your efforts and the info. Found that also in MSDN in the
meantime, but this works only with NT.
In 95 the section, but not the keys and nothing gets filled in. Under 98 the
whole registry layout changed and
the mentioned branch in the registry is no longer present...

So i am one step further now, but the problem remains to be solved for
95/98....

Thanks

Greetings from Africa..

Peter



Quote:

> Peter,

> Found this in MSDN, hope it helps.

> When a client accepts an IP address, and any other configuration
information
> offered by the DHCP server, the client saves the configuration in the
> following Registry keys:
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services: Network interface
> specific: <adapter>\parameters\Tcpip General: Dhcp\parameters\options\*
> IP addressing information is leased to a client until the client manually
> releases the address, or until the DHCP server cancels the lease and makes
> the address available to other computers on the network.


> >Does anybody know how to find out the current DNS servers when using
> dynamic
> >(DHCP) Nameservers on dial up?
> >I have no problem to read the DSN server IP('s) from the registry when
they
> >are fixed. But how do i obtain the info when DNS servers are given
> >dynamically via DHCP or on PPP dial up?

> >Example: I dial up to my ISP, PPP negotiotes my IP number and DNS
servers.
> >How can my program find out the DNS numbers obtained?

> >Alreday known/discoverd:
> >- winipcfg.exe can do write the information to a file, but it is a bit
> >akward  and very slow to shell out to a .exe and then read the results
from
> >a file.
> >- there is a ipcfgdll.dll in Windows 98 that appears to be a dll version
of
> >winipcfg.exe.Ipcfgdll.dll exports functions that appear to do the job,
but
> >the dll is not documented. Anybody knows the function syntax for the
> exports
> >of ipcfgdll.dll ?

> >Thanks

> >Peter



Sun, 31 Mar 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to determine current DNS server IP number?

2. Update DNS Host IP in a Zone - Windows 2000 Server

3. Determining Who is your DNS Server

4. Determine the index number of the current shape

5. Current control number - how to determine

6. Determine current line number in textarea

7. System.Net.DNS using different DNS server

8. HOW CAN I GET THE IP NUMBER FROM THE SERVER

9. ? determine the number of computer attached to a Netware server

10. DATES ISSUE: Number of the current Week of the current Month

11. Tcp/ip or Ip number ?

12. Resolve IP Numbers to IP Names in VB4

 

 
Powered by phpBB® Forum Software