Repository navigation
Releases
v2.0.0
v1.2.0 – CIDR Export and Value Filters
mmdbio CLI - Release 1.2.0
Release Date: 2026-10-05
Version: 1.2.0
New Features
export: value filters and CIDR lists
--where field<op>value: export only records that match. Operators:=and!=(comma-separated values),>=,<=,>,<(numbers). Repeat the flag to combine conditions; all must match. Matching ignores case, and array fields such asvpn_provider_namesmatch on any element.--format cidr: write one CIDR per line instead of JSON. Adjacent networks are merged into the fewest CIDRs by default.--aggregate=false: keep each network exactly as it is stored in the database.--family 4|6: export only IPv4 or only IPv6 networks.--out -: write to stdout. The summary line goes to stderr.
Example Usage
# IPv4 VPN exits as a CIDR list
mmdbio export --db db-ip-security.mmdb --where is_vpn=true --family 4 --format cidr --out vpn-v4.txt
# Exported 2353364 networks as 1929272 CIDRs to vpn-v4.txt
# Every network in two countries
mmdbio export --db db-ip-country.mmdb --where location.country.code2=CN,RU --format cidr --out cn-ru.txt
# Combine conditions
mmdbio export --db db-ip-security.mmdb --where is_proxy=true --where 'threat_score>=80' --format cidr --out risky.txt
# Filter a JSON export
mmdbio export --db db-ip-security.mmdb --where is_tor=true --fields is_tor,threat_score --out tor.jsonMerging shrinks lists a lot on detailed databases. For example, the German IPv4 networks in the weekly City database go from 681,795 to 91,192 CIDRs, and cloud provider IPv4 networks in the Security database from 6,666,391 to 108,242.
The README has a new Using CIDR Lists section with tested examples for nftables, ipset and iptables, firewalld, nginx, Apache, Caddy, HAProxy, Traefik, Squid, Postfix, Suricata, Zeek, and cloud WAF limits.
Changes and Fixes
- Behavior change:
exportno longer writes each IPv4 network 4 times for IPv6 databases. The extra copies came from the::ffff:0:0/96, Teredo2001::/32, and 6to42002::/16aliases. JSON exports are now about a quarter of the size; otherwise the records are unchanged. exportdecodes each unique record once. Exporting a weekly Country database dropped from 97 s to 1.3 s.- JSON output from
exportnow ends with a newline. - Requires Go 1.25 or newer to build or
go install, following thegolang.org/x/syssecurity update (#6).
Full Changelog: v1.1.0...v1.2.0
SHA-256 Checksums
cb1f74a4b7aa94d8f2beffa741dd06b28de960a231ab1a33107c6069a2c7d551 mmdbio-1.2.0-darwin-amd64.tar.gz
bb7157c23d612f06c59e9d4dd76bd8efc299edaddf5242539e58654ab1d80a4d mmdbio-1.2.0-darwin-arm64.tar.gz
c62d041364bfa92d848b1032c93911cf46f2ce27ae69fd7553eee171547f72ca mmdbio-1.2.0-linux-amd64.tar.gz
d7321beb365fcfb4d039c5edd6dac1e7cf617e87ac9d29c70aad66830a1361f9 mmdbio-1.2.0-linux-arm64.tar.gz
b35eab2631f6c8f24b4fcddf65b5e8a534f8d629f38a7e20d8270f637aa73e05 mmdbio-1.2.0-windows-amd64.zip
v1.1.0 – Introducing the Import Command
mmdbio CLI - Release 1.1.0
Release Date: 2025-11-11
Version: 1.1.0
New Features
import command
- Import JSON file and generate
.mmdbdatabases. - Supports:
- IPv4 and IPv6
- Mixed IPv4/IPv6 JSON input
- IP ranges, single IPs, and CIDRs
- Flags:
--in, -i: Input JSON file path--out, -o: Output.mmdbfile path--ip: IP version (4 or 6), default is 6--size: Record size (24, 28, 32), default is 32--merge: Merge strategy (none,toplevel,recurse), default -> none--alias-6to4: Enable IPv6 to IPv4 aliasing for hybrid databases, default (false)--disallow-reserved: Skip reserved IP blocks, default (false)--title: Custom title for the.mmdbdatabase--description: Custom description for the.mmdbdatabase
Example Usage
# Import IPv4-only JSON
mmdbio import --in ipv4_export.json --out ipv4_data.mmdb --ip 4 --size 32
# Import IPv6-only JSON
mmdbio import --in ipv6_export.json --out ipv6_data.mmdb --ip 6
# Import mixed JSON (IPv4 + IPv6) with 6to4 aliasing
mmdbio import --in all_data.json --out all.mmdb --ip 6 --alias-6to4
# Import and skip reserved IP ranges
mmdbio import --in dataset.json --out filtered.mmdb --disallow-reservedv1.0.0 - Initial Stable Release
MMDBIO CLI v1.0.0 Release Notes
Overview
mmdbio v1.0.0 is the first official release of the MMDB CLI tool. This tool allows users to work with MaxMind MMDB files including reading, exporting, comparing, inspecting, verifying, and viewing statistics.
Installation
Go install
go install github.com/IPGeolocation/mmdbio@v1.0.0Build from Source
git clone https://github.com/IPGeolocation/mmdbio.git
cd mmdbio
go build -o mmdbio .Prebuilt Binaries
Download binaries from GitHub Releases for Linux, macOS, and Windows. Rename and place in your PATH for easy usage.
Commands
read- Lookup IPs from MMDB files.metadata- Show MMDB metadata.export- Export MMDB to JSON.diff- Compare two MMDB files.inspect- Inspect structure and export schema.stats- View statistics.verify- Validate MMDB file.completion- Generate shell completions.
Example Usage
mmdbio read --db GeoIP2-City.mmdb --ip 8.8.8.8 --fields location.country.name
mmdbio export --db GeoIP2-City.mmdb --out export.json
mmdbio diff --old old.mmdb --new new.mmdb --summary
mmdbio inspect --db GeoIP2-City.mmdb --out schema.json
mmdbio stats --db GeoIP2-City.mmdb --json
mmdbio verify --db GeoIP2-City.mmdbNotes
- Ensure
$GOBINor$GOPATH/binis in your PATH. - Prebuilt binaries and shell completion scripts available in GitHub Releases.