IP 地理定位如何工作?

发布于 2024-08-16 11:11:41 字数 1827 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

摇划花蜜的午后 2024-08-23 11:11:42

要快速开始地理定位,请打开命令行并输入 tracert stackoverflow.com 并密切关注结果。大多数情况下,前几行已经给出了有关您所在位置的重要提示。

For a quick start into geolocation, open a command line and enter tracert stackoverflow.com and pay close attention to the results. Mostly, the first few lines already give away important hints about your location.

巴黎夜雨 2024-08-23 11:11:42

基本上他们是根据 IP 地址猜测。他们在某个地方有一个 IP 地址范围和位置的列表。他们根据 whois、traceroute 和/或用户反馈的查找进行维护。

例如,MaxMind 似乎主要依靠用户反馈来保持其列表的最新状态。

人们使用 VPN 和代理来绕过 IP 基础地理封锁。有时该表只是有错误的数据。

如果你想要一些便宜且有效的东西,并且不担心疏远你的用户,那么这是一个很好的解决方案。不要期望超过 99% 的结果都位于实际用户位置 2000 英里范围内。

Basically they guess based on the IP address. somewhere they have a list of ip-address ranges and locations. which they maintain based on lookups against whois, traceroute, and/or user feedback.

MaxMind for instance seems to rely mostly on user feedback to keep its lists current.

People use VPNs amt Proxies to get around IP baes geoblocking. and sometimes the table just have wrong data.

If you want somtjhing that's cheap and mostly works and aren't worried about alienating your users it;s a good solution. don't expect better than 99% of results to be within 2000 miles of the actual user location.

腹黑女流氓 2024-08-23 11:11:41

将 IP 地址映射到地理位置是通过表完成的,其中 IP 映射到特定位置。不过,此位置不需要准确,因为 IP 地址不包含有关其位置的任何信息,这些都是近似值

来自维基百科关于互联网地理定位的文章:

IP 地址数据的主要来源是区域互联网注册机构,它们在位于各自服务区域的组织之间分配和分发 IP 地址:

  • 非洲网络信息中心 (AfriNIC)
  • 美国互联网号码注册机构 (ARIN)
  • 亚太网络信息中心 (APNIC)
  • 拉丁美洲和加勒比互联网地址注册机构 (LACNIC)
  • RIPE 网络协调中心 (RIPE NCC)

次要来源包括:

  • 数据挖掘或用户提交的地理位置数据:
    • 网站提交,例如天气网站要求访问者提供城市名称以查找当地天气预报,或将用户的 IP 地址与其帐户个人资料中的地址信息配对。
    • Wi-Fi定位系统通过检查邻近的Wi-Fi BSSID。例如 Mozilla 定位服务。
    • 检查附近的蓝牙设备。
    • 将用户的 IP 地址与使用该 IP 地址的设备的 GPS 位置进行配对。
  • 数据由互联网服务提供商提供。
  • 来自相邻 C 类范围和/或从网络跃点收集的猜测。
  • 收集到 IP 地址端点的网络路由信息。
  • 使用预训练模型分析来自设备的语言数据,这些模型显示某个术语在某个位置被频繁提及(例如“the T”、“the El”和“the Subway”)。

通过以下方式提高准确性:

  • 数据清理以过滤或识别异常情况。
  • 对用户提交的数据进行统计分析。
  • 利用信誉良好的组织进行的第三方测试。

Mapping IP addresses to geolocations is done via tables, where an IP maps to a particular location. This location, however, doesn't need to be accurate, since IP addresses don't carry any information about their locations, these are approximated.

From Wikipedia's article on Internet geolocation:

The primary source for IP address data is the regional Internet registries which allocate and distribute IP addresses amongst organizations located in their respective service regions:

  • African Network Information Centre (AfriNIC)
  • American Registry for Internet Numbers (ARIN)
  • Asia-Pacific Network Information Centre (APNIC)
  • Latin American and Caribbean Internet Address Registry (LACNIC)
  • RIPE Network Coordination Centre (RIPE NCC)

Secondary sources include:

  • Data mining or user-submitted geographic location data:
    • Website-submitted, e.g. a weather website asking visitors for a city name to find their local forecast or pairing a user's IP address with the address information in their account profile.
    • Wi-Fi positioning system through the examination of neighborhood Wi-Fi BSSID. E.g. Mozilla Location Service.
    • Examination of neighborhood Bluetooth devices.
    • Pairing a user's IP address with the GPS location of a device that's using such an IP address.
  • Data contributed by Internet service providers.
  • Guesstimates from adjacent Class C range and/or gleaned from network hops.
  • Network routing information collected to the end point of IP address.
  • Analysis of linguistic data from the device, using pretrained models that show that some term is frequently mentioned in a certain location (e.g. "the T" vs "the El" vs. "the subway").

Accuracy is improved by:

  • Data scrubbing to filter out or identify anomalies.
  • Statistical analysis of user submitted data.
  • Utilizing third-party tests conducted by reputable organizations.
水中月 2024-08-23 11:11:41

据我了解,IP 子网被分配给服务提供商上游的提供商 - 因此,每个 IP 范围都被标记为位于该提供商的原籍国家/地区内,因此该范围内的每个 IP 都被假定位于该国家/地区内。

这并非万无一失 - 我们之前(在英国)由比利时提供商向我们提供卫星宽带。每次我们用谷歌搜索任何内容时,我们都会被要求只查看比利时境内的页面。

As I understand it, IP subnets are assigned to the providers upstream of your service providers - each IP range is therefore flagged as being within the country of origin of that provider, so each IP within that range is assumed to be within that country.

This is not foolproof - we previously had satellite broadband provided to us (in the UK) by a Belgian provider. Each time we googled anything, we'd be offered to see only pages within Belgium.

不可一世的女人 2024-08-23 11:11:41

有许多组织负责管理 IP 地址的分配,例如美国互联网号码注册机构 (ARIN)。这些组织维护分配的 IP 地址块及其分配位置的主列表,并经常发布更新的列表。

地理定位软件充分利用这些列表,并提供将 IP 地址映射到国家/地区的快速方法。一般来说,商业产品会努力提高准确性并利用其他数据源。

查看维基百科上的地理定位软件文章,了解有关该主题的一些有趣链接。

There are a number of organizations that manage the allocation of IP addresses, such as the American Registry of Internet Numbers (ARIN). These organizations maintain master lists of allocated IP address blocks and where they are allocated to, and publish updated lists frequently.

Geolocation software takes full advantage of these lists and provides quick methods of mapping IP addresses to countries. Generally commercial products will strive for more accuracy and utilize other data sources as well.

Check out the Geolocation Software article on wikipedia for some interesting links on the topic.

反差帅 2024-08-23 11:11:41

互联网基础设施中有一个叫做自治系统的东西,定义这里

至少分配其中一项。 AS 具有唯一的 ASN(自治系统编号),在该 AS 内可以拥有网络(WAN 和 LAN)。

这些被分配给提供商,这些提供商当然有一个位置,因此路由协议通过 ASN 知道它们位于哪个区域。

使用 WHOIS 服务,我们可以确定 IP 地址属于谁,因为我们大多数人都分配了一个 IP 地址通过我们的提供商上网时,在 WHOIS 上,您主要会找到您所在提供商的城镇。但是 WHOIS 是一个网站,您会找到它的所有者,因此地理定位经常使用该服务。

There's in the internet infrastructure something called an Autonomous System, defintion here

Each provider has been assigned at least one of these. An AS has a unique ASN (Autonomous System Number), within that AS one can have networks (WAN & LAN).

These are assigned to providers, which off course have a location, so the routing protocols know by the ASN what zone they're in.

Using WHOIS services one can determine who an IP address belongs to, as most of us are assigned an IP address by our provider when going online, on WHOIS, you'll mostly find the town of the provider you're in. But WHOIS a website, you'll find it's owner, so Geolocation uses that service a lot.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文