mmdbinspect
Look up records for IPs and networks in MaxMind .mmdb databases
Description
mmdbinspect is a CLI tool from MaxMind for looking up records for one or more IP addresses or networks in one or more .mmdb (MaxMind DB) databases. It outputs results as JSON or JSONL, making it ideal for scripting and integration with tools like jq. It supports glob patterns for database paths and can query multiple IPs against multiple databases in a single invocation. Requires MaxMind GeoLite2 or GeoIP2 database files.
Install
brew install mmdbinspectgo install github.com/maxmind/mmdbinspect/v2/cmd/mmdbinspect@latestAI Summary
CLI tool for looking up IP geolocation and network information from MaxMind .mmdb database files, with JSON output.
Capabilities
- + Look up geographic location data for IP addresses
- + Query multiple IPs or CIDR networks in a single command
- + Search across multiple .mmdb database files simultaneously
- + Output results as JSON array or JSONL for scripting
- + Support glob patterns for database file paths
- + Return country, city, ASN, and other network metadata
Use When
- → When you need to find the geographic location of an IP address
- → When scripting IP geolocation lookups with JSON output
- → When querying MaxMind GeoLite2 or GeoIP2 databases from the command line
- → When you need to look up multiple IPs at once
Avoid When
- x When you do not have MaxMind .mmdb database files downloaded
- x When you need a hosted geolocation API rather than a local database lookup
- x When you need real-time IP reputation or threat intelligence data
Usage Patterns
Look up an IP address
mmdbinspect -db /path/to/GeoLite2-City.mmdb 8.8.8.8 Returns geolocation data for Google's DNS server
Look up multiple IPs
mmdbinspect -db /path/to/GeoLite2-City.mmdb 8.8.8.8 1.1.1.1 Looks up geolocation for multiple IP addresses at once
JSONL output for streaming
mmdbinspect -jsonl -db /path/to/GeoLite2-City.mmdb 8.8.8.8 Outputs one JSON record per line for easier piping
Typical Pipelines
mmdbinspect -db GeoLite2-City.mmdb 8.8.8.8 | jq '.[0].Records[0].Record.city.names.en'