IP localization: mapping ip->location fixed over time?

廉价感情. 提交于 2019-12-05 22:42:30

The mapping from IP to location change over time. I have read that the databases change 5% each month, even though its hard to know if they really change that much or if the database providers lie to sell their updates more often. But its a fact that these databases change. So you should obtain the location of an IP address asap, at least not later that a month after you captured the IP address.

In case you want to store the demographic data, you should save the country information retrieved instead of IP address, due to the nature it may changes from time to time.

You can use third party sites to gelocalize ip.

I usually use:

https://www.geo-ip.net/locate?query=stackoverflow.com&format=json

Ipregistry author there. Yes, IP allocations change over time. As an example, with my service, client libraries store lookup results for up to 24h but we recommend not to use a long period.

Indeed, RIR (Regional Internet Registry) data change, some ISP (Internet Service providers) make use of dynamic IP addresses and companies who have allocations (especially IPv4) rent or resell allocations, which results in frequent changes.

In case you are using a service like Ipregistry, which also returns threat data for a given IP address, it is even recommended to not cache the result for more than 1 hour since threat data change even more frequently!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!