Вопрос

I want to geolocate people from there IP. I know there are services online with an API.

I want to know if there is any way to calculate this data on my own (In other words, is there any way to manually map 192.168.0.1 to (say) New York)?

Это было полезно?

Решение

First, "calculate" is not the right word for it. There is nothing to calculate, it is simple mapping of IP to location. First, you would have to map IP blocks to ISPs. Then get the location of the ISPs. Manually. This is a huge task, and you need to constantly update the list, especially with IPv6 fast growing.

I see no reason to do the job yourself. There are APIs, use them. Maxmind does a great job at providing accurate information such as country, region, ISP name.

Другие советы

MaxMind's free GeoLite databases are probably your best bet.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top