This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get IP address in linux

 
shiva kumar nanda
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you getting when you do InetAddress.getLocalHost()?.
what does your /etc/hosts have?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic