iptoasn-go

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2025 License: MIT

README

iptoasn-go

This is a utility for efficiently using the iptoasn.com GeoIP data in Go programs, by converting the raw .tsv data to the mmdb format (MaxMind DB File Format). It uses the maxmind/mmdbwriter library for the mmdb conversion.

Usage

  1. Installation - go install github.com/case/iptoasn-go/cmd/iptoasn@v1.0.0
  2. Usage - iptoasn --download -o iptoasn.mmdb - downloads and converts the default ip2asn-combined.tsv.gz file
  3. Use the resulting .mmdb file in your Go programs, via the oschwald/geoip2-golang library

Misc

Minimum Go version supported - 1.24 (as required by maxmind/mmdbwriter)

IPtoASN supported files:

  • ip2asn-combined.tsv.gz
  • ip2asn-v4.tsv.gz
  • ip2asn-v6.tsv.gz
  • ip2country-v4.tsv.gz
  • ip2country-v6.tsv.gz

Thank you 🙏

  • Frank Denis, for providing the iptoasn.com data service
  • MaxMind, for the mmdb file format, and the read & write Go code
  • Julia Evans, for her explorations in the space

Directories

Path Synopsis
cmd
iptoasn command
Command iptoasn downloads IP-to-ASN data from iptoasn.com and builds MMDB files.
Command iptoasn downloads IP-to-ASN data from iptoasn.com and builds MMDB files.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL