Geo Data
mihomo ships with built-in URLs for the four geographical-data files it uses for routing rules (GEOIP, GEOSITE, ASN matches). Override any of them with geox-url. The four geo-* top-level keys below tune refreshing and loader behavior.
geox-url
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
geoip | string | (built-in) | <URL> | Download URL for the binary GeoIP database (geoip.dat). |
mmdb | string | (built-in) | <URL> | Download URL for the MaxMind-format database (Country.mmdb). |
asn | string | (built-in) | <URL> | Download URL for the ASN database (used by `GEOSITE,asn:...` rules). |
geosite | string | (built-in) | <URL> | Download URL for the GeoSite domain-tag database (geosite.dat). |
Source: config/config.go:357-362 · pinned at v1.19.27 (5184081)
Top-level keys
| Field | Type | Default | Allowed values | Description |
|---|---|---|---|---|
geo-auto-update | bool | false | true | false | Refresh the four geo files on startup and at every geo-update-interval. |
geo-update-interval | int | 24 | <hours> | Refresh interval in hours when geo-auto-update is on. |
geodata-mode | bool | (build default) | true | false | Use the binary `geoip.dat` instead of the MaxMind `Country.mmdb`. The build-time default is platform-dependent. |
geodata-loader | string | memconservative | memconservative | standard | Loader implementation. `memconservative` keeps a smaller resident set; `standard` is faster at first match. |
geosite-matcher | string | (loader default) | hybrid | succinct | Domain-matching algorithm for the GeoSite database. |
Source: config/config.go:393-460 · pinned at v1.19.27 (5184081)
Example
yaml
geo-auto-update: true
geo-update-interval: 24
geodata-mode: true
geodata-loader: memconservative
geosite-matcher: succinct
geox-url:
geoip: https://example.com/geoip.dat
mmdb: https://example.com/Country.mmdb
asn: https://example.com/GeoLite2-ASN.mmdb
geosite: https://example.com/geosite.datNotes
- The four files are fetched lazily on first use unless
geo-auto-updateis enabled. - Switching
geodata-modeswaps which file is consulted forGEOIPrules:trueusesgeoip.dat,falseusesCountry.mmdb. The ASN and GeoSite files are not affected.
Source: config/config.go:357-460 · v1.19.27 (5184081)
