This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Getting location information from the IP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Getting location information from the IP" Watch "Getting location information from the IP" New topic
Author

Getting location information from the IP

Girish Vasmatkar
Ranch Hand

Joined: Apr 24, 2008
Posts: 199
Hello Ranchers,

I want to build an application which will get the IP address of the client machine and based on the IP address the location of the client will be determined and that info will be pasted on a Map.Does anyone have any idea how this can be done.Determining the IP address is pretty simple but i am unable to locate the machine from the IP address.If anyone has worked on this before please guide me.Waiting for the reply...

Thanks and Regards
Girish
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41064
    
  43
You're apparently not subscribed to the JavaRanch Journal, where we recently had an article on this very subject. Shame on you :-)
[ August 13, 2008: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4646
    
    5

Of course, the location information is just an informed estimate. Just as "on the internet, no one knows you are a dog" on the 'net, no one really knows where an IP address is.

This may improve when IPv6 is widespread, but NATs to a great job of obfuscating location.

More importantly, sometimes, the network doesn't do what you expect. A while ago, I worked for a worldwide consulting company. When I was in their Dusseldorf Germany office, I noticed that the IP addresses were part of their Fairfax VA (USA) office. And with a little investigation, the main, fastest link was a T1 from Germany to the US. So the IP address's geolocation was off by a few thousand miles, a major ocean, and several international borders.
Paul Michael
Ranch Hand

Joined: Jul 02, 2001
Posts: 697
Originally posted by Ulf Dittmer:
You're apparently not subscribed to the JavaRanch Journal, where we recently had an article on this very subject. Shame on you :-)

[ August 13, 2008: Message edited by: Ulf Dittmer ]


Easy Ulf... I'm subscribed to the newsletter but I only noticed the very nice article on Mapping IP's when I was about to clean up my mail.

Hope to see really exciting topics like this one in your next release!


SCJP 1.2 (89%), SCWCD 1.3 (94%), IBM 486 (90%), SCJA Beta (96%), SCEA (91% / 77%), SCEA 5 P1 (77%), SCBCD 5 (85%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting location information from the IP
 
Similar Threads
Getting the REAL ip address
How to get IP Address of Client Machine?
rmiregistry on a different machine
Track client request
How can I resolve the IP address of a PC into the location of that PC