Solved

How to get Gateway, DNS server address/name

Posted on 2000-04-18
1
394 Views
Last Modified: 2010-04-10
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
Comment
Question by:sanesh
1 Comment
 
LVL 1

Accepted Solution

by:
yanissim earned 100 total points
ID: 2734035
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now