# mmdbinspect
> Look up records for IPs and networks in MaxMind .mmdb databases

## 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

## When to Use
- 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

## When NOT to Use
- When you do not have MaxMind .mmdb database files downloaded
- When you need a hosted geolocation API rather than a local database lookup
- 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

## Installation
- **homebrew**: `brew install mmdbinspect`
- **go**: `go install github.com/maxmind/mmdbinspect/v2/cmd/mmdbinspect@latest`

## Related Tools
- [asn](/tools/asn) (complementary): asn is a broader network investigation tool with geolocation capabilities

---
Source: https://littlescripts.sh/tools/mmdbinspect
