Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to get Gateway, DNS server address/name

Posted on 2000-04-18
1
Medium Priority
?
406 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
yanissim earned 300 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

670 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