M
M
mihass2015-03-06 17:10:28
Geolocation
mihass, 2015-03-06 17:10:28

How to determine the geo affiliation of an IP address without using the maxmind.com, ipgeobase.ru, etc. databases?

Good afternoon!
How and where can you find out the real geographic location of an IP address?
For example, there is one IP address. maxmind.com says it's Kyiv, ipgeobase.ru says it's Simferopol, several services like 2ip.ru say it's Kharkiv.
How and where to find out how really? Whois indicates the location of the provider's office, but the provider provides services in many cities.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
T
throughtheether, 2015-03-06
@throughtheether

Purpose of geolocation specify where and how the data will be used?
Actually, I wanted to make sure of something. And made sure.
From my point of view, you do not quite understand what and why you need. What is the "geographical affiliation of the IP address"? Geographic affiliation can be observed for a person, his house, apartment, client device, but not for some 32-bit number. The correspondence between a client device and a globally routable IPv4 address that a server sees on the Internet is a generally fickle and sporadic thing.

How and where to find out how really?
in fact?
Get access to the provider's internal documentation (device configurations, geo-referenced network map) and compare heterogeneous data. All other methods, bases will give you only the first approximation.
If we consider the task of determining the city of a web store client for the purpose of personalization, for example, then I would do this. First, determining the position of several popular databases, according to the registrar of IP addresses (RIPE for Europe / CIS). Some algorithm would determine the most "specific" match. For example, if RIPE and one base say that the host is located in Kyiv, and the other base - that in Lviv, would choose Lviv as a more specific option. Further, I would show the client an unobtrusive form: "we assume that you are from such and such a city, if this is not so, then please specify the data" and set the appropriate cookie parameter for him.
In short, IP addresses are only a first approximation of a client's geographic location. As the practice of renting IPv4 prefixes by Internet companies from each other develops, the obsolescence of information in various databases will accelerate. Depending on the goals, you may need the HTML5 Geolocation API or some implementation of its analogue (i.e. using not only the IP address, but also other data, GPS in the case of a smartphone, SSID of monitored Wi-Fi access points, etc.)
UPD2 :I forgot to mention one more thing, sometimes you can infer the location of a host based on its name, in this case the PTR record (for example, hostXXXXXX.dyn.kiev.isp.ua). Again, the correctness of this data is not guaranteed, there was a relevant story about five years ago with a PTR like rostelecom-fsb in the traceroute output to livejournal.com or a similar service (with an understandable reaction of service users, "37th year is back" and so on).

P
Puma Thailand, 2015-03-06
@opium

In fact,
IPs are scarce now and providers hang out as best they can to optimize use, so such flaws are more than likely.

A
Alex_B, 2019-03-25
@Aleks_B

Definitions of geolocation by IP is a whole science.
You can read articles about how this is happening at the moment and what new technologies have been developed quite recently.
Bigdatacloud.net provides convenient APIs and 10k requests for each of them per month, absolutely free of charge, without restrictions on data accuracy and detail.

E
Evgeny Nikolaev, 2019-11-25
@nikolaevevge

Regarding IpGeoBase, here is info blog.ivru.net/?id=82

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question