geo
Гео-базы MaxMind GeoLite2, сети стран и IP-листы. Cron каждый день в 06:30 (UTC+3) проверяет источники; файлы меняются только когда меняются данные.
База GeoLite2 от —, листы от —.
Файлы
| Путь | Что |
|---|---|
manifest.json | даты, размеры и sha256 всех файлов ниже |
GeoLite2-City.mmdb | город/страна по IP (~50 МБ) |
GeoLite2-ASN.mmdb | ASN и организация по IP (~9 МБ) |
GeoLite2-Country.mmdb | только страна (~3 МБ) |
geolite2_data.txt | дата базы одной строкой YYYYMMDD, без перевода строки (совместимость) |
countries.zip | IPv4-сети стран: файл на страну <Name>_<N>.txt, строки start-end, имена стран MaxMind (en), N — число диапазонов |
countries/<ISO2>.txt | то же по одной стране, в CIDR: countries/RU.txt |
countries/index.json | список стран: {"RU": {"name", "ranges", "cidr", "size"}} |
lists/datacenter-ipv4.txt | сети датацентров и хостингов, CIDR (X4BNet/lists_vpn) |
lists/vpn-ipv4.txt | сети известных VPN, CIDR (X4BNet/lists_vpn) |
lists/tor-exits.txt | выходные узлы Tor, IP (torproject) |
lists/ipsum.txt | IP из чёрных списков: IP<TAB>число списков, строки # — комментарии (stamparm/ipsum) |
lists/updated.txt | дата последнего изменения листов YYYY-MM-DD |
manifest.json
{
"updated": "2026-11-03T08:27:59Z",
"geolite2": {"date": "20261101", "tag": "2026.11.01", "source": "P3TERX/GeoLite.mmdb 2026.11.01",
"files": {"GeoLite2-City.mmdb": {"size": 50786929, "sha256": "…"}, …}},
"countries": {"date": "20261101", "count": 250, "ranges": 361843,
"zip": {"size": 2326002, "sha256": "…"},
"cidr": {"dir": "countries/", "index": "countries/index.json", "count": 250}},
"lists": {"date": "2026-11-03",
"files": {"vpn-ipv4.txt": {"size": 181666, "sha256": "…", "lines": 11079}, …}}
}
Обновлять базу — по geolite2.date; страны пересобираются из той же базы и идут с той же датой.
Листы — по lists.date. Если источник листа не ответил или вернул подозрительно короткий список,
остаётся прежний файл.
Примеры
# сети РФ одним списком CIDR
curl -s https://api.byfox.dev/geo/countries/RU.txt | wc -l
# пора ли обновить базу (сравнить с сохранённой датой)
[ "$(curl -s https://api.byfox.dev/geo/geolite2_data.txt)" -gt "$(cat local_date.txt)" ] && echo пора
Источники и лицензии
- GeoLite2 © MaxMind, через зеркало релизов P3TERX/GeoLite.mmdb; условия — GeoLite2 EULA.
- X4BNet/lists_vpn, stamparm/ipsum, torproject bulk exit list.
MaxMind GeoLite2 databases, country networks and IP lists. A cron job checks the sources daily at 06:30 (UTC+3); files change only when the data changes.
GeoLite2 of —, lists of —.
Files
| Path | What |
|---|---|
manifest.json | dates, sizes and sha256 of every file below |
GeoLite2-City.mmdb | city/country by IP (~50 MB) |
GeoLite2-ASN.mmdb | ASN and organization by IP (~9 MB) |
GeoLite2-Country.mmdb | country only (~3 MB) |
geolite2_data.txt | database date as one YYYYMMDD line, no newline (compatibility) |
countries.zip | IPv4 networks per country: one file <Name>_<N>.txt per country, lines start-end, MaxMind English names, N = number of ranges |
countries/<ISO2>.txt | the same for one country, as CIDR: countries/RU.txt |
countries/index.json | country list: {"RU": {"name", "ranges", "cidr", "size"}} |
lists/datacenter-ipv4.txt | datacenter and hosting networks, CIDR (X4BNet/lists_vpn) |
lists/vpn-ipv4.txt | known VPN networks, CIDR (X4BNet/lists_vpn) |
lists/tor-exits.txt | Tor exit nodes, IPs (torproject) |
lists/ipsum.txt | blacklisted IPs: IP<TAB>number of lists, # lines are comments (stamparm/ipsum) |
lists/updated.txt | date the lists last changed, YYYY-MM-DD |
manifest.json
{
"updated": "2026-11-03T08:27:59Z",
"geolite2": {"date": "20261101", "tag": "2026.11.01", "source": "P3TERX/GeoLite.mmdb 2026.11.01",
"files": {"GeoLite2-City.mmdb": {"size": 50786929, "sha256": "…"}, …}},
"countries": {"date": "20261101", "count": 250, "ranges": 361843,
"zip": {"size": 2326002, "sha256": "…"},
"cidr": {"dir": "countries/", "index": "countries/index.json", "count": 250}},
"lists": {"date": "2026-11-03",
"files": {"vpn-ipv4.txt": {"size": 181666, "sha256": "…", "lines": 11079}, …}}
}
Update the databases by geolite2.date; countries are rebuilt from the same database and carry the same date.
Lists go by lists.date. If a list source fails or returns a suspiciously short list, the previous file stays.
Examples
# Russian networks as one CIDR list
curl -s https://api.byfox.dev/geo/countries/RU.txt | wc -l
# is it time to update (compare with the stored date)
[ "$(curl -s https://api.byfox.dev/geo/geolite2_data.txt)" -gt "$(cat local_date.txt)" ] && echo update
Sources and licenses
- GeoLite2 © MaxMind, via the P3TERX/GeoLite.mmdb release mirror; terms: GeoLite2 EULA.
- X4BNet/lists_vpn, stamparm/ipsum, torproject bulk exit list.