aspose file tools*
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
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: 8903
    
    8

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get The Public IP Of My System Using Java??