Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #206386 > unrolled thread

GeoIP free databases and Geo::IP

Started byfrancis picabia <fpicabia@gmail.com>
First post2019-03-20 10:30 +0100
Last post2019-06-15 15:20 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.debian.user


Contents

  GeoIP free databases and Geo::IP francis picabia <fpicabia@gmail.com> - 2019-03-20 10:30 +0100
    Re: GeoIP free databases and Geo::IP MI <mi.lists.debian@alma.ch> - 2019-06-15 15:20 +0200

#206386 — GeoIP free databases and Geo::IP

Fromfrancis picabia <fpicabia@gmail.com>
Date2019-03-20 10:30 +0100
SubjectGeoIP free databases and Geo::IP
Message-ID<xDFHQ-2X8-5@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

The packages geoip-database in Debian relies
on static databases which are no longer being updated.

https://support.maxmind.com/geolite-legacy-discontinuation-notice/

All I need from this is a quick way on the shell to look up
a country from an IP.

On Debian I could do that with geoiplookup
or use a small perl script using Geo::IP

These tools still work, but the accuracy is drifting off over time.

I could make my own script solution around calls to https://freegeoip.app
but I can't be the only one looking into this issue.  Surely someone has
figured out something to do this well that gets that good ol' 1000 eyeballs
treatment.

Has anyone encountered something like Geo::IP which will work against
the other free resources?  Or has anyone encountered a solution
which will work against the new GeoIP databases available by subscription
from Maxmind, the previous supplier of the free GeoLite DB?

Something like this done in a script would work:

wget -qO - https://freegeoip.app/csv/$IP | awk -F, '{print $3}'

It is limited to 10,000 lookups per hour and it is much slower than
working against a local DB file.

Is there something better?

[toc] | [next] | [standalone]


#209932

FromMI <mi.lists.debian@alma.ch>
Date2019-06-15 15:20 +0200
Message-ID<y9gL7-6j0-1@gated-at.bofh.it>
In reply to#206386
I have the same problem. For my needs, the best solution I found turns 
out to be the workaround you suggested using https://freegeoip.app.

The alternative seems to be something like

     apt install geoipupdate mmdb-bin

     # use the free license in GeoIP.conf:
     cp /usr/share/doc/geoipupdate/examples/GeoIP.conf.default 
/etc/GeoIP.conf

     geoipupdate

     # update every Tuesday
    echo "04 04 * * 2 root /usr/bin/geoipupdate" >> /etc/crontab

Then you have mmdblookup, which outputs some clumsy pseudo-json that 
needs to be parsed.

So thank you for the simple workaround you suggested :

>     wget -qO - https://freegeoip.app/csv/$IP | awk -F, '{print $3}'
>
So

> Is there something better?
>
For my use case (I only need about a dozen lookups per day), that's the 
best I could find


MI

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web