Code Monkey home page Code Monkey logo

Comments (12)

tiwilliam avatar tiwilliam commented on May 18, 2024

Hi Phillip,

That address works fine in my GeoLiteCity database, where did you get yours? Any chance I can get your database to try to see if it's an underlying problem in pygeoip? An empty dictionary can be returned when the IP address can not be found in the database, or the lookup method fail for some reason.

from pygeoip.

p0bailey avatar p0bailey commented on May 18, 2024

Hi William,

I downloaded the file from here:

http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz

Here you can find mine:

http://bailey.st/files/GeoLiteCity.dat

I've downloaded a new db file and just to be sure I've made a md5sum of the files, it looks fine.

md5sum GeoLiteCity.dat.*
037a996de48e77e8d1d0fb9ceca49e6d GeoLiteCity.dat.NEW
037a996de48e77e8d1d0fb9ceca49e6d GeoLiteCity.dat.OLD

Now I'm puzzled.

Phillip

from pygeoip.

p0bailey avatar p0bailey commented on May 18, 2024

This is the version of pygeoip I'm using.

pip search pygeoip
pygeoip - Pure Python GeoIP API
INSTALLED: 0.2.6 (latest)

from pygeoip.

tiwilliam avatar tiwilliam commented on May 18, 2024

The database does not contain information for the IP. I did a sanity check with the Ruby library:

>> GeoIP.new('GeoLiteCity.dat').country('91.201.64.20')
=> nil

I will altough make a change to return None instead of {} to make it consistant with how the organisation miss work.

from pygeoip.

p0bailey avatar p0bailey commented on May 18, 2024

I don't know why someone else didn't come across to this problem before, looks weird maxmind is missing one ip from the database.

from pygeoip.

tiwilliam avatar tiwilliam commented on May 18, 2024

I think Maxmind are excluding addresses with status ALLOCATED UNSPECIFIED, meaning the address is yet to be allocated from RIPE NCC.

from pygeoip.

p0bailey avatar p0bailey commented on May 18, 2024

This ip belong to a botnet command control server.

from pygeoip.

tiwilliam avatar tiwilliam commented on May 18, 2024

Hardcore, but I don't think this is an pygeoip issue though, Maxmind might help you further.

Thanks for reporting.

from pygeoip.

p0bailey avatar p0bailey commented on May 18, 2024

Anyway thanks for your effort and time.

from pygeoip.

p0bailey avatar p0bailey commented on May 18, 2024

Hi William,

Sorry to comment on a closed issue. Are you going to make the change to return None instead of {} ?

from pygeoip.

tiwilliam avatar tiwilliam commented on May 18, 2024

Yes, record_by_addr will in >= 0.2.7 return None instead of {}

from pygeoip.

p0bailey avatar p0bailey commented on May 18, 2024

This fix will really help if you iterate through an ip addresses txt file, as I'm doing.

Thanks very much,

from pygeoip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.