How do I use MaxMind's GeoIP database to deter

2020-04-19 07:52发布

So, I was told in my previous question that I can use the databases provided by MaxMind to determine locations.

So, I got their databases downloaded from their site. They are csv files and open up in Excel.

InetAddress ip = InetAddress.getLocalHost() is how I get the IP of my computer. From there I do String justIP = ip.getHostAddress()

My question is:

  • How do I resolve justIP to a city location using the DB I just downloaded ???

  • I am new to this so a little help will be appreciated.

    One of the files has three columns. startIPNum, endIPNum and locID I do not know what these do but I guess locID maps to a city and country location in the other file.

    1条回答
    Explosion°爆炸
    2楼-- · 2020-04-19 08:58

    Did you tried the Java examples from Maxmind? http://dev.maxmind.com/geoip/downloadable#Java-8
    And see http://dev.maxmind.com/geoip/csv for field descriptions

    查看更多
    登录 后发表回答