Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obtaining IP address without using getComputerName() 1

Status
Not open for further replies.

dysonsphere

Programmer
Feb 24, 2003
1
0
0
US
I would like to know how one can obtain the IP Address of the local Windows2k machine without using the stupid getComputerName() api from the Computer class? This name is crap since if you have in some DHCP networks, this name and the actual network name that you are assigned are different. So how can one reconcile their IP Address, hopefully directly from the adapter, without going through the windoz stuff? I am familiar with the normal x/open and posix socket apis but do not see a way to use them until I have a trusted name. Hopefully the is some ioctly api or something that can help.

Does anyone have any ideas? How does the IPCONFIG command get the IPAddress? That would probably help if someone out there know that answer. Thanks! ":)
 
ipconfig /release and ipconfig /renew commands.
Also, type ipconfig /? to get a list of all switches.
 
in Win2K, unlike 9x's winipcfg, the ipconfig command is not a GUI utility; so...

open a command prompt first & @ the prompt type: "ipconfig /all"

...without the quotes, of course. this will display all you need to know (ip address, mac address, default gateway, dns servers, etc...) - Tim S.
A+, Net + certified
MCSA in training
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top