Is it safe to accept uniform geo-ip resolution for the same first 16-bit IP addresses?

I have a geoinfected webapp for which I send the IP address of the request to the remote commercial ip-to-location service and return the country, city, Internet provider, etc. for the IP address.

I am currently caching IP requests in my database to make subsequent searches faster and free (commercial search fees).

I wonder if I can optimize my caching again by assuming that the first 16 bits (i.e. aaa.bbb at aaa.bbb.ccc.ddd addresses) always have a uniform location. Thus, I can store no more than 2 ^ 15 records. I do not mind the uniformity of the ISP, but this information will also be useful.

+3
source share
2 answers

I would recommend going down at least / 24 permissions. Often a / 16 will tell you the provider, but not the city, or vice versa.

If you want to get a good idea of ​​how the cards look, you can spend $ 49 on a Geobytes GeoNetMap developer license . The developer license allows you to download the entire map from IP blocks to locations as a group of CSV files, but does not apply to its deployment on a production server. The advantage of Geobytes is that it is completely local, so search queries flow quickly.

MaxMind also has a free downloadable map offer , although it is slightly reduced from the full map, resulting in a double error rate.

0

, . , GeoIP 216.34.181.45 (Slashdot), Mountain View, California. 216.34.1.1, , .

, , IP- . - - , IP- .

0

Source: https://habr.com/ru/post/1789085/


All Articles