Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to get the country name from IP address?

807588Feb 12 2009 — edited Feb 12 2009
Hello All,

I am able get the IP address of the visitors by using

String ipAddress = request.getRemoteAddr(); .

I'm also getting the host name by using

InetAddress iaddress = InetAddress.getByName( ipAddress );
String ipaddr = iaddress.getHostName();

But... I'm not able to find the Country's name from which that IP is coming from.
Is there any class in JAVA that will help me find the respective country's name??

Thank u!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 12 2009
Added on Feb 12 2009
7 comments
1,057 views