Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

InetAddress

 
Shaili Suri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need help in resolving IP address of a supplied server name. Currently, the application is using InetAddress.getHostAddress() to extract IP address from provided server name.
The problem here is this returns the private IP address of the server name. If I need the public IP address, then what should I use?
Thanks,
Shaili
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am not absolutly sure about that. But the java classes simply use the operating systems host resolving method. (hosts file, DNS etc.).
so it will always give you the same ip like e.g.
# ping your.host
If you want to have a different ip to be retrieved just change the names
config.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic