如何确定远程计算机的位置,给定其 IP(无需付费)?
我从事这个项目已经有一段时间了。我发现有很多免费数据库可以将 IP 号码(IP 地址的某种操作)映射到长纬度坐标。然而,这些数据库的准确性确实很差。
我尝试在一些数据库之间进行合并,并合并最常见的答案或答案中的“平均值”。
这确实提高了我的准确性,但没有我预期的那么多。
我还有另一个想法——使用Traceroute命令找出到这个目标的路径,并根据途中的跳数来确定我的目标在哪里。
我正在寻找新的想法或某种有助于确定位置的协议。我一直在考虑公共 cookie,但这可能太具有侵入性。此外,一位朋友告诉我,SNMP 协议可能对我有帮助,但实现起来非常复杂。
我的目标是确定这台计算机位于哪个城市。这就是我瞄准的准确度。
感谢并抱歉我的英语!
I've been working on this project for a while. I found out that there any many free databases which map between IP number (sort of manipulation of the IP adress) to a long and latitude cordinates. Howerver , these database accuracy is realy bad.
I tried to merge between some databases , and to the best frequent answer or the "average" among answers.
That did improve my accuracy , but not as much as i expected .
I have another idea - using Traceroute command to figure out to the path to this target , and according to the hops on the way to determine where my target is.
I'm looking for new ideas , or some kind of protocols that will help to figure out the location. I've been thinking about public cookies , but that might be too invasive . Furthermore , a friend told me that SNMP protocol might help me , but it is highly complicated to implement.
My goal is to deteremine in which city this computer is. This is the accuray i'm aiming it.
thanks and sorry for my english!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 HTML5 的新地理定位。示例:http://html5demos.com/geo
(取自上面的链接)
代码:
至于数据库,我'一直沿着这条路走下去,没有一个完美的解决方案,所有数据库只能为您提供大约 50 英里的精度。
这样您就可以使用 Ajax 将位置数据推送到您的服务器。
You could use HTML5's new geolocation. Example : http://html5demos.com/geo
(taken from link above)
Code:
As for databases, I've been down that road, there isn't a perfect solution all the databases will only give you around 50 mile accuracy.
With this you could use Ajax to push the location data to your server.
它无法可靠地工作。例如,假设以下场景:
我的公司有 VPN。
有了这个,我无需亲自到场即可从我的公司获取 IP 地址。
我在哪里?是在我公司那个地方吗?或者在世界的另一端,我度假的地方?
我与我的提供商有拨号连接。
我在哪里?在拨入节点所在的位置,还是我真正所在的位置?
这两个例子表明IP地址本身不保存(也不可能保存)任何地理信息。这可能与经验相关 - 用户将他们的(动态?)IP 地址输入数据库,与他们当前的 IP 地址相关,但仅此而已。可以这么说,这是系统固有的,它不可能是精确的。
如果您寻找通过 ADSL 和动态 IP 地址上网的“普通用户”,您不知道提供商从同一个池中获取地址的区域有多大。在我终止连接后,下一个获取此 IP 地址的用户可能距离我 50 公里、500 公里甚至 2000 公里(取决于您居住的国家/地区)。
即使分配给企业客户的固定 IP 也可能会改变其位置:企业搬迁,或者不再存在,IP 地址被分配给完全不同的客户。
随着 IPv6 越来越流行,所有这些都将在未来几个月/几年内再次发生变化。
It cannot work reliably. E.g., take the following scenarios:
I have a VPN at my company.
With this, I can get an IP address from my company without being physically present.
Where am I? At the place of my company? Or at the other side of the world, where I spend my holidays?
I have a dialup connection to my provider.
Where am I? At the point where the dial-in node sits, or where I really am?
These two examples show that the IP address itself does not hold (and cannot hold) any geographical information. It can be related to such by experience - users enter their (dynamical?) IP address into a database, related with their current IP address, but that's all. So to say, it is inherent to the system that it cannot be exact.
If you look for the "average user", which goes online via ADSL and a dynamic IP address, you don't know how big the area is where the provider take the adresses from the same pool. After I kill my connection, the user getting this IP address next might be 50 km, 500 km or even 2000 km away from me (depending on the country you live in).
Even a fixed IP assigned to a business customer might change its location: the business moves, or it ceases to exist and the IP address gets assigned to a completely different customer.
And all this stuff will change again in the next months/years with IPv6 getting more and more popular.