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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding the servers IP adres...

Status
Not open for further replies.

math

Programmer
Mar 21, 2001
56
0
0
BE
We have a server (Win2000, IIS) but our ip-adres is dynamic... we want to create a perl-script that finds the cuurent ip and upload it to our homepage (on our provider)... So what is the command to find the ip of the server the script is running on? Is there a way?

Thanks in advance,

math
 
Could you use the loopback address? (127.0.0.1) Mike
michael.j.lacey@ntlworld.com
Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.
 
You can use 'ipconfig' on the winOS to get your address....

#!perl
@netStuff = `ipconfig`; # [red] <= back ticks[/red]
foreach (@netStuff)
{
print &quot;=> $_ \n&quot;;
}


HTH


keep the rudder amid ship and beware the odd typo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top