Skip to content

GeoIP and GeoSite

GEOIP and GEOSITE rules, and geosite: keys in dns.nameserver-policy, look addresses and domains up in two databases that ship with the app.

Database Format Used by
Country database MaxMind MMDB (Country.mmdb, MetaCubeX edition), IPv4 and IPv6 GEOIP rules
GeoSite database v2ray geosite.dat (MetaCubeX edition) GEOSITE rules, geosite: keys in nameserver-policy

Both databases are built into the app. On first launch (and after an app update that ships newer data) they are unpacked on the device. MeowX never downloads them, so they work even where GitHub is unreachable, and they don’t depend on any configuration key.

As a result, these mihomo keys are ignored: geox-url, geodata-mode, geodata-loader, geo-auto-update, geo-update-interval. The data is updated with app releases.

rules:
- GEOIP,CN,DIRECT
- GEOIP,PRIVATE,DIRECT,no-resolve
  • The payload is an ISO country code, compared case-insensitively.
  • PRIVATE matches the private and reserved ranges tagged as such in the bundled database.
  • Works for IPv4 and IPv6 destinations.
  • Needs the destination IP. For connections that only have a domain (fake-ip mode, local proxy), the domain is resolved unless the rule has no-resolve; see Rules → no-resolve.
rules:
- GEOSITE,category-ads-all,REJECT
- GEOSITE,geolocation-!cn,Proxy
- GEOSITE,cn,DIRECT
dns:
nameserver-policy:
"geosite:cn,apple-cn": https://dns.example.net/dns-query
  • The payload is a category name from the database, compared case-insensitively. Names containing ! or - (such as geolocation-!cn) are ordinary category names and work as written.
  • Each entry of a category is matched as in v2ray: full domain (exact), root domain (the domain and its subdomains), keyword (substring) and regular expression.
  • Only the categories that your rules and nameserver-policy actually reference are loaded, to save memory. The result is cached on the device, so after the first connection with a given set of categories, starting the tunnel is fast.
  • A category name that doesn’t exist in the database never matches.
Feature Status
GeoSite attributes (GEOSITE,google@cn, GEOSITE,category-games@!cn) Not supported. A payload with @ never matches. Attributes are ignored when loading, so a plain category such as google includes its @cn entries too.
GEOSITE inside a classical rule provider Matches only if the same category is also referenced by a top-level rule or nameserver-policy.
geosite: entries in fake-ip-filter Not supported (ignored).
GEOIP,LAN (mihomo’s built-in local-network match) Not supported; never matches. Use GEOIP,PRIVATE or IP-CIDR rules.
IP-ASN / ASN database Not bundled; IP-ASN rules never match.
Custom or replacement database files Not supported.