to find ip address

thomasliju
thomasliju used Ask the Experts™
on
How will we find the ip address for this machine

nyspcor01g[oracle:coreaux1]

This is sunsolaris
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
helpfinderIT Consultant

Commented:
try to use ping command.
ping nyspcor01g
if nyspcor01g is a hostname you should get back recolved IP
Most Valuable Expert 2012
Distinguished Expert 2018
Commented:
Try:
ifconfig -a
Top Expert 2007
Commented:
you may run the command

ifconfig -a

which will show you the network interfaces and their IPs

OR

you could run

grep `hostname` /etc/hosts

OR

nslookup `hostname`
Why Diversity in Tech Matters

Kesha Williams, certified professional and software developer, explores the imbalance of diversity in the world of technology -- especially when it comes to hiring women. She showcases ways she's making a difference through the Colors of STEM program.

Shahnawaz AhmedCloud Migration Engineer

Commented:
Dear thomasliju,


You will find by the below 2 commands, give a try now

ifconfig -a  

cat /etc/hosts | grep <server_name>
Most Valuable Expert 2011
Top Expert 2012

Commented:
Since the question was originally posted in the Oracle Database topic area, I'll assume you want an Oracle solution as well.

use the UTL_INADDR package


select UTL_INADDR.get_host_address('nyspcor01g') from dual;

Note, in 11g or higher databases you'll need an ACL that allows the RESOLVE privilege

Author

Commented:
This is good for any servers..
Most Valuable Expert 2012
Distinguished Expert 2018

Commented:
thomasliju,

Can you explain why you accepted the post you did? ifconfig and /etc/hosts had both been posted previously.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial