• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 410
  • Last Modified:

How to get Gateway, DNS server address/name

is there any api to get the gateway, dns server address/name..?

any idea about the location in registry where it is located..

sanesh@hclt.com
0
sanesh
Asked:
sanesh
1 Solution
 
yanissimCommented:
if you are using Win2k you can use
the IP helper library,
On nt4 you can extarct the info from the registry,
every installed adapter which is bind to
TCP/ip has a TCP/IP key where all the info you need is stored - including IP address,mask,gateway,etc..

lets say you have one network adapter
under HKLM/software/Microsoft/Windows Nt/Current version/Network cards/1
check the servicename value - this is the name of the base driver instance -
E100b1 for Intel 10/100 adapter.
then, go to HKLM/System/CurrentControlSet/Services/E100B1/TCPIP/Parameters and you will see everything you want
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now