a basic understanding of Go and of IP addresses and CIDR notation will be helpful, but allowances have been made for the intrepid explorer for whom these concepts are novel!.
your working directory (which can be located under any parent directory) must be named mmdb-from-go-blogpost (if you clone the code using the instructions below, this directory will be created for you).a copy of the GeoLite2 Country database must be in your working directory.the mmdbinspect tool must be installed and be in your $PATH.Go 1.14 or later must be installed, and go must be in your $PATH.you must have git installed in order to clone the code and install the dependencies, and it must be in your $PATH.
Maxmind db how to#
If you don’t need any of the MaxMind data, but you still want to create a fast, easy-to-query database keyed on IP addresses and IP address ranges, you can consult this example code showing how to create an MMDB file from scratch.
We’ll be building a new MMDB file, one that contains both MaxMind’s and our fictional company’s data. In this article, we’re going to add details about a fictional company’s IP address ranges to the GeoLite2 Country MMDB file. If, however, you have your own data associated with IP address ranges, you can create hybrid MMDB files, enriching existing MMDB contents with your own data. For many situations these MMDB files are useful enough as is. MaxMind offers several prebuilt MMDB files, like the free GeoLite2 Country MMDB file. While MMDB files are usable on a variety of platforms and in a number of different programming languages, this article will focus on building MMDB files using the Go programming language. MaxMind DB (or MMDB) files facilitate the storage and retrieval of data in connection with IP addresses and IP address ranges, making queries for such data very fast and easy to perform.