Code Monkey home page Code Monkey logo

geoiplookup's Introduction

GeoIPLookup - geoiplookup for GeoLite2 written in Go

Geoiplookup is a geoiplookup replacement for the free GeoLite2-Country,

It currently only supports the free GeoLite2-Country database, and there is no planned support for the other types.

Features

  • Drop-in replacement for the now defunct geoiplookup utility
  • Works with the current Maxmind database format (mmdd)
  • IPv4, IPv6 and fully qualified domain name (FQDN) support
  • Options to return just the country iso (US) or country name (United States), rather than the full GeoIP Country Edition: US, United States
  • Built-in database update support
  • Built-in self updater (if new release is available)

Installing

Multiple OS/Architecture binaries are supplied with releases. Extract the binary, make it executable, and move it to a location such as /usr/local/bin.

Updating

GeoipLookup comes with a built-in self-updater:

geoiplookup self-update

Compiling from source

You must have golang installed. There is one external library required (oschwald/geoip2-golang) which is downloaded automatically when you run make:

git clone [email protected]:warrengalyen/geoiplookup.git
cd geoiplookup
make

Basic usage

Usage: geoiplookup [-i] [-c] [-d <database directory>] <ipaddress|hostname|db-update|self-update>
Options:
  -V	show version number
  -c	return country name
  -d string
    	database directory or file (default "/usr/share/GeoIP")
  -h	show help
  -i	return country iso code
  -v	verbose/debug output
Examples:
geoiplookup 8.8.8.8			Return the country ISO code and name
geoiplookup -d ~/GeoIP 8.8.8.8		Use a different database directory
geoiplookup -i 8.8.8.8			Return just the country ISO code
geoiplookup -c 8.8.8.8			Return just the country name
geoiplookup db-update			Update the GeoLite2-Country database (do not run more than once a month)
geoiplookup self-update			Update the GoIpLookup binary with the latest release

geoiplookup's People

Contributors

warrengalyen avatar

Watchers

 avatar

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.