• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get The Public IP Of My System Using Java??

 
ramakrishna rayudu
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

i have requirement that i neeed to get the Public IP address of The System..
when ever i am Useing The InetAddress Class It return The LocalIP is there any way to get Public Ip of The System Using The Java???

Thanks,
Ramakrishna Rayudu,
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by public? The IP returned by InetAddress should be your machine's address in the network to which it belongs.
 
Joe Ess
Bartender
Posts: 9256
9
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Services that provide Dynamic DNS provide a service to check one's external IP address: http://checkip.dyndns.com/
Of course, what that IP actually resolves to, and whether a request sent to that IP would actually be routed back to your machine depends on your network configuration.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic