Alex Rivera | Logout

How to determine the IP address of a Solaris system

Asked 2009-03-31T18:02:13.030
38

What command do I want to issue when I want to know the IP address of the Solaris machine I'm logged onto?

Edit
Report

2 Answers

2

There's also:

getent $HOSTNAME

or possibly:

getent `uname -n`

On Solaris 11 the ifconfig command is considered legacy and is being replaced by ipadm

ipadm show-addr

will show the IP addresses on the system for Solaris 11 and later.

answered 2013-03-09T21:09:40.020
0
/usr/sbin/host `hostname`

should do the trick. Bear in mind that it's a pretty common configuration for a solaris box to have several IP addresses, though, in which case

 /usr/sbin/ifconfig -a inet | awk '/inet/ {print $2}'

will list them all

answered 2009-04-10T09:19:15.297

Your Answer