本文介绍了获取2个IP地址之间的地理距离?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何计算2个IP地址之间的地理距离(例如500英里)?
How can you calculate the geographic distance (e.g. 500 miles) between 2 IP addresses?
是否有一些API可供您查看?
Is there some API that lets you look this up?
推荐答案
这可能是您最接近的:正如@carl Norum所说,由于ISP和DNS服务器位置以及其他有趣的路由魔法,并非所有IP地址都解析为物理位置。但是,如果您确实获得了客户端的ISP,则由该ISP发布其客户端的物理地址。
This might be the closest you're gonna get: Who provides a WHOIS API? as @carl norum said not all IP addresses resolve to a physical location due to ISP and DNS server locations and other fun routing magic. But if you do get the client's ISP it's up to that ISP to release the physical address of their client.
这篇关于获取2个IP地址之间的地理距离?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!