Getting Unix machine IP address | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Getting Unix machine IP address

Shell Programming and Scripting


Tags
linux

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 04-28-2006
asutoshch asutoshch is offline
Registered User
 
Join Date: Mar 2001
Last Activity: 4 January 2013, 3:32 AM EST
Location: Calcutta, India
Posts: 75
Thanks: 2
Thanked 0 Times in 0 Posts
Getting Unix machine IP address

Can someone help me how I can find the IP address of the AIX Unix machine ? I want to use some command from a Bourn shell script.

Thanks in advance
asutoshch
Sponsored Links
    #2  
Old 04-28-2006
ranj@chn ranj@chn is offline Forum Advisor  
Registered User
 
Join Date: Oct 2005
Last Activity: 25 August 2011, 2:35 AM EDT
Location: Chennai
Posts: 370
Thanks: 0
Thanked 5 Times in 4 Posts
how about

how about nslookup mach_name
Sponsored Links
    #3  
Old 04-28-2006
Awadhesh's Avatar
Awadhesh Awadhesh is offline
Registered User
 
Join Date: Jul 2005
Last Activity: 7 July 2008, 9:23 AM EDT
Location: Delhi, India
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Bug Re

#ifconfig -a to see the IP Address.
man ifconfig

Cheers,
Awadhesh
    #4  
Old 04-28-2006
Ambikesh Ambikesh is offline
Registered User
 
Join Date: Feb 2006
Last Activity: 10 September 2009, 1:10 PM EDT
Location: California
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Yup.. nslookup will work..
Sponsored Links
    #5  
Old 04-28-2006
buffoonix buffoonix is offline
Registered User
 
Join Date: Mar 2006
Last Activity: 26 January 2009, 11:26 AM EST
Posts: 145
Thanks: 0
Thanked 1 Time in 1 Post
On most Unices (except for Linux)

netstat -in

will show you IP addresses bound to plumbed NICs.

If you know the NIC's device name you could also use (e.g. en0 on a PowerPC)

ifconfig en0

I assumed you meant the box'es own IP address(es).
Otherwise query a name service with tools like nslookup.
Sponsored Links
    #6  
Old 04-29-2006
asutoshch asutoshch is offline
Registered User
 
Join Date: Mar 2001
Last Activity: 4 January 2013, 3:32 AM EST
Location: Calcutta, India
Posts: 75
Thanks: 2
Thanked 0 Times in 0 Posts
Thanks a lot. Both nslookup and ifconfig did work.
Sponsored Links
    #7  
Old 04-30-2006
Santi Santi is offline
Registered User
 
Join Date: Jan 2006
Last Activity: 2 April 2009, 5:45 PM EDT
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Hello,

Try with the examples for Linux boxes posted at:

console address

Regards,

--
Santi Saez
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
IP address of Unix machine thoothukudiking UNIX for Dummies Questions & Answers 9 08-26-2008 02:15 PM
IP address of machine harneet2004us UNIX for Advanced & Expert Users 3 04-16-2008 04:54 PM
How to get Windows machine's IP address from Unix? mvictorvijayan Shell Programming and Scripting 3 12-05-2007 11:45 PM
how to retrieve IP address of a machine mridula IP Networking 5 11-02-2005 08:21 AM
How to get IP Address of machine? Ahsan Programming 7 10-24-2003 11:16 AM



All times are GMT -4. The time now is 03:40 PM.