Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting location information from the IP

 
Girish Vasmatkar
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic