获取 IP 地址信息

发布于 2025-01-19 18:37:09 字数 108 浏览 1 评论 0原文

我个人使用 API 来获取有关 IP 地址的信息,例如来源、公司等。但是该 API 是如何获取这么多有关 IP 的信息的呢?如果有人知道请回答。知道如何在 Javascript 中获得它并且非常有帮助。

I personally use an API to get info about an Ip address like, it's origin, company etc. But how does that API get's that much info about the IP? If anyone knows it please answer. Knowing how to get that in Javascript and help very much.

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

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

发布评论

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

评论(1

命比纸薄 2025-01-26 18:37:09

令人惊讶的是,它并不是很复杂。

从本质上讲,每个 IP 地址都注册到一家公司。那家公司有地址。 GeoIP 公司创建了 IP 地址及其相关地址信息的数据库。地址可以转换为坐标,包括邮政编码、城市/县/州/国家信息等。如果 GeoIP 公司能够区分……分配给 ISP 客户的 IP 或分配给服务器场、大学、星巴克等的 IP,则可以关联更多数据……您甚至可以开始提出自己的“声誉”方案对于各种IP。有些 IP 可能是“坏”的,因为它们发送大量垃圾邮件或托管诈骗网站。

如今,GeoIP 被许多服务所使用。一个著名的例子是 Netflix。他们使用 GeoIP 数据库来确定用户是否在美国并且应该看到某些内容,而在英国的用户是否由于许可限制而应该看到不同的内容。

因此,互联网提供商、服务器提供商和企业有一个发明来“注册”他们的 IP 地址,并确保它们在 GeoIP 公司中正确列出,否则用户可能无法观看 Netflix、Amazon Video 或其他一些服务。注册为 GeoIP 公司的数据库提供了越来越多的数据。

这些数据库并不准确,因为知道您 IP 的人知道您的房子在哪里,但他们可能知道城市。

我刚刚检查了我的 IP,它返回到我的本地互联网提供商(与康卡斯特或其他大公司不同的小型本地提供商),它的 GeoIP 坐标距离我家的中央办公室大约 4 英里。

It’s surprisingly not very complicated.

At its core, every IP address is registered to a company. That company has an address. GeoIP companies created databases of IP addresses and their associated address information. The addresses can be converted to coordinates, include things like postal codes, city/county/state/country information, and more. Even more data can be associated if the GeoIP company can differentiate between…say…IPs assigned to customers of an ISP or IPs assigned to server farms, colleges, starbucks, etc… You can even start to come up with your own ‘reputation’ scheme for various IPs. Some IPs might be ‘bad’ because they send a lot of spam, or host scam sites.

Now-a-days, GeoIP is used by a lot of services. A well-known example is Netflix. They use GeoIP databases to figure out if a user is in the United States and should see certain content verses someone in the UK who should see different content due to licensing restrictions.

Because of this, internet providers, server providers, and businesses have an inventive to ‘register’ their IP addresses and make sure they are listed correctly with GeoIP companies—otherwise users might not be able to watch Netflix, Amazon Video, or some other service. Registering provides more and more data to the GeoIP companies for their databases.

The databases aren’t accurate in the sense that someone knowing your IP knows where your house is, but they probably know the city.

I just checked my IP and it comes back to my local internet provider (a small local provider unlike Comcast or the other big players) and it has GeoIP coordinates that are about 4 miles away from my house at their central office.

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