File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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?
I agree. Here's the link:
subject: how to get IP address in linux
jQuery in Action, 3rd edition