wood burning stoves 2.0*
The moose likes Sockets and Internet Protocols and the fly likes How to get The Public IP Of My System Using Java?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "How to get The Public IP Of My System Using Java??" Watch "How to get The Public IP Of My System Using Java??" New topic
Author

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

ramakrishna rayudu
Ranch Hand

Joined: Mar 08, 2011
Posts: 57
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

Joined: Apr 14, 2004
Posts: 10336

What do you mean by public? The IP returned by InetAddress should be your machine's address in the network to which it belongs.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to get The Public IP Of My System Using Java??
 
Similar Threads
how to get ip address
how can i get ipaddress or hostname using macaddess
host name from an IP
Getting IP Address
how can i get client IP?