aspose file tools
The moose likes Sockets and Internet Protocols and the fly likes how to get IP address in linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "how to get IP address in linux" Watch "how to get IP address in linux" New topic

how to get IP address in linux

shiva kumar nanda

Joined: May 10, 2007
Posts: 8
I am working on Linux.
I have a problem of getting the IP Address.
Can any one help me in getting the IP Address.
And my IP Address changes day by day.

Using InetAddress class i am able to get the IP Address on Windows, but this is failing on Linux.

Thank You
Arun Bommannavar
Ranch Hand

Joined: Jan 11, 2003
Posts: 53
What are you getting when you do InetAddress.getLocalHost()?.
what does your /etc/hosts have?
It is sorta covered in the JavaRanch Style Guide.
subject: how to get IP address in linux