GeoIP and GeoSite Database Updates: Rule References, Load Checks, and Rollback

Learn how GeoIP and GeoSite databases differ, where to update them, how to check compatibility and rule tags, and how to restore routing when logs show load failures.

At a glance

This guide is for users of v2rayN, v2rayNG, or v2flyNG who already use routing rules but are seeing missing tags, startup failures after an update, or changed routing results. Back up your rules and data files first, then update GeoIP and GeoSite and verify each layer through startup logs, match results, and live connections. If something goes wrong, roll back the files, rules, and core in that order.

First, understand what GeoIP and GeoSite match

GeoIP and GeoSite are both classification databases read by the routing module, but they operate on different inputs. GeoIP matches destination IP addresses, such as geoip:private or geoip:cn in a rule. GeoSite matches domain names, such as geosite:cn and geosite:category-ads-all. GeoIP cannot directly determine a domain category, and GeoSite does not replace IP-range matching.

The common filenames are geoip.dat and geosite.dat. These files are only containers for classification data; rules reference the tags inside them. Different data sources, build dates, or slimmed-down variants may include different tags, so a successful download does not mean every tag used by the current rules is available. Before updating, record the tags you actually use instead of looking only at the file date.

2 files
geoip.dat and geosite.dat
3 checks
Files, tags, and rule matches
10808
This guide uses a local SOCKS port
30 seconds
Initial log window after restart
What GeoIP and GeoSite match and when to use them
Data type Match target Rule example Important note
GeoSite Domain in the request geosite:cn The tag must exist in the current geosite.dat, and rule order also affects the result.
GeoIP Target IPv4 or IPv6 address geoip:private Whether the domain is resolved to an IP first depends on the routing DNS strategy.
Explicit domain Full domain, suffix, or keyword domain:example.com Does not depend on a GeoSite tag, making it useful for a small number of critical exceptions.
Explicit network range Specified CIDR range 192.168.0.0/16 Does not depend on GeoIP classification; LAN direct-connect rules should usually come first.
Domain requestGeoSite matchResolved addressGeoIP matchSelect outbound

This sequence does not necessarily occur in full every time. In Xray routing, for example, domainStrategy set to AsIs generally applies raw-domain rules first and does not actively resolve the domain for GeoIP matching. IPIfNonMatch attempts resolution when no domain rule matches, then continues with IP rules. IPOnDemand may trigger resolution when a rule requires the destination IP. If routing changes after a database update, check the strategy and rule order together.

Bottom line: identify the match target before deciding that the database is broken

If a domain does not match geoip:cn, the data file is not necessarily damaged. With the AsIs strategy, the request may never enter destination-IP classification at all. Check the domain strategy and the destination address shown in the logs before replacing the data files.

Save three types of rollback data before updating

Updating Geo data normally does not change VMess, VLESS, TLS, or REALITY node parameters, but it can change which routing tags are available and what they classify. The safe approach is to save the current rules, data files, and core information before replacing anything. That makes it possible to tell whether a failure comes from the rules, the data, or a core change.

In v2rayN, open Settings → Routing settings first, then record the enabled rule sets, rule order, and default outbound. Check the active core type on the main screen. With Xray, data files in an extracted installation are commonly stored in the relevant core resource directory. Directory layouts can differ between v2rayN 7.x builds, so follow the resource path shown in the startup log or the directory selected by the client instead of overwriting another core's files based on a similar filename.

  1. Export or copy the routing configuration: Preserve the active rule order, especially LAN direct connections, blocking rules, specified domains, and the final fallback rule.
  2. Copy the existing data files: Place geoip.dat and geosite.dat in a dated local backup folder so they do not get mixed with the new files.
  3. Record the core and client state: Note whether the current core is Xray or v2fly, whether it started normally before the update, and whether the test node was reachable.
  4. List custom tags: Search the routing configuration for geoip: and geosite:, and record uncommon tags separately.
  5. Update one resource set at a time: Do not replace the core, subscription, DNS settings, and Geo data simultaneously, or it will be difficult to identify the cause of a log error.

On desktop, copy the files after stopping the core to avoid replacing them while they are being read. On Android, v2rayNG and v2flyNG usually manage their resource directories themselves, so there is no need to search for files inside the system sandbox. Use the in-app Geo resource update or import option first, and export custom configuration before making changes. v2rayNG uses the Xray core, while v2flyNG uses the v2fly core. Their support for basic geoip.dat and geosite.dat rules is similar, but that does not mean every extended tag and configuration field is identical.

The update entry point only replaces resources; it cannot prove that the rules remain compatible

In v2rayN, use Settings → Check for updates → Geo files to download the files, then restart the core and inspect the logs. A completed progress indicator only confirms that the update action finished; it does not confirm that tags loaded or that routing matches correctly.

Check rule tags, order, and core compatibility

The most common Geo data compatibility issue is not that the file cannot be read at all, but that a custom tag is missing from the new data. Basic tags such as geoip:private are common, while region, service-category, and extended-attribute tags depend on the dataset. If the rules came from an older configuration or another data source, confirm before updating that the new files still provide the same tags.

Rule order matters just as much. Routing usually checks rules in sequence, so a broad rule near the top can override a more specific rule below it. For example, if a wide-ranging GeoSite category comes before a direct-connect rule for one domain, the latter may never run. For critical domains, place explicit exceptions before broad categories and keep a final fallback outbound.

Domain classification rule

Input
Requested domain
Tag
geosite:cn
Outbound
direct
Requirement
Tag exists and the domain is visible

Useful for classifying requests by domain first, then letting later rules handle unmatched requests.

Address classification rule

Input
Destination IP
Tag
geoip:private
Outbound
direct
Strategy
Works with domainStrategy

LAN addresses should connect directly first so management pages and local services do not use the proxy outbound.

The following is a shortened routing snippet for understanding the structure. When importing it into v2rayN, outbound tags must match the tags in the current configuration. If the client uses different names, use its existing values rather than copying this example mechanically.

{
  "routing": {
    "domainStrategy": "IPIfNonMatch",
    "rules": [
      {
        "type": "field",
        "ip": ["geoip:private"],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "domain": ["domain:intranet.example"],
        "outboundTag": "direct"
      },
      {
        "type": "field",
        "domain": ["geosite:cn"],
        "outboundTag": "direct"
      }
    ]
  }
}

Here, domain:intranet.example is an explicit domain rule that does not depend on GeoSite data, making it useful as a safeguard for a critical internal service. If a new GeoSite file lacks a business category, temporarily convert a small number of essential domains to explicit rules to restore basic access. Then decide whether to find compatible data or redesign the categories. Do not delete all routing rules at once because of a single missing tag.

Use startup logs to confirm that files and tags loaded

To determine whether an update succeeded, fully stop the old core and start it again instead of merely closing the settings window. The core usually reads Geo data at startup or when a referenced tag is first parsed. If the old process is still running, current connections may continue using the old resources even after the files on disk have been replaced.

In v2rayN, stop the service, restart the selected configuration, and watch the first 30 seconds in the log window. If the test environment uses the local SOCKS port 127.0.0.1:10808, first confirm that the inbound listener started successfully, then check for Geo-related errors. If the core failed to start because the port is occupied, subsequent routing tests are meaningless. 10808 is only the port used in this guide; use the local listener configured under Settings → Parameters.

Log symptoms and the recommended first response
Log or symptom Possible cause Next step
geoip.dat or geosite.dat not found The file is not in the resource directory used by the current core, or the update was written to another core's directory. Confirm the resource path in the startup log and restore the original file to the location the current core actually reads.
list not found or tag missing A rule references a classification tag that is not included in the new data. Restore the old data, or change the rule to a tag present in the new file and restart.
The core starts, but routing goes the wrong way The rule order, domain strategy, or classification contents changed. Enable routing logs and compare the actual outbound for a fixed test domain.
The local port is not listening The core exited while reading the configuration or resources, or the port may be occupied. Address the first error before anything else; do not infer Geo data status from browser results.

Error messages can vary slightly between core versions, but the diagnostic order is the same: find the first fatal error in the log, then determine whether it points to a file path, tag name, or configuration field. Later connection failures are often just a consequence of the core failing to start. Search for geoip, geosite, routing, failed, and the specific tag name.

The update finished. Why do the logs still show the old routing result?

Stop the core in the client, confirm in Task Manager that the old process has exited, and then restart the configuration. Replacing the files without restarting the core may leave the current process using the data it already loaded.

What should I do if a GeoSite tag cannot be found?

Open Settings → Routing settings and locate the geosite: tag named in the log. Restore the old file first to verify that the configuration can start, then check whether the new data provides the same tag. If it does not, adjust the rule instead of repeatedly replacing the files.

The core starts, but a specified domain still uses the wrong outbound. What should I do?

Temporarily write the domain as an explicit domain: rule and place it before the broad category. If the explicit rule matches, the connection path is working; continue by checking the GeoSite category contents and rule order.

Do I need to re-import the subscription after updating v2rayNG?

Usually not. Geo resources and VMess or VLESS node subscriptions contain different information. Restart the current configuration and check the runtime log first. Update the subscription only when the subscription's node parameters have changed.

Can testing only whether a website opens confirm that routing is correct?

No. A reachable website only proves that one usable outbound exists. Test an expected direct destination, an expected proxy destination, and a LAN target separately, then use routing logs to confirm the outbound tag used by each request.

Roll back through files, rules, and the core when an update fails

The goal of a rollback is to restore the last known-good state quickly, not to keep making changes while the system is failing. Stop the core first, move the new geoip.dat and geosite.dat out of the resource directory, and put the backup files back. After restarting, if the original rules work again, the issue is narrowed to the new data or tag compatibility.

If the problem remains after restoring the old data, restore the routing configuration exported before the update, paying particular attention to rule order, domainStrategy, and outbound tags. If both the data and rules are restored but the core still cannot start, check whether the Xray or v2fly core was also changed during the update. Record the client version, core version, and data files separately so three variables are not combined into one update.

Once connectivity is restored, establish a regular maintenance routine: back up both data files and the routing configuration before an update; afterward, check the local port, the first log error, and three fixed test targets; delete temporary backups only after everything is confirmed. Geo data does not need frequent replacement just because the date changed. Update it when the rules genuinely depend on new address ranges or domain classifications.

Final check: it must start, connect, and match correctly

A successful core startup only proves that the resources can be read, while an accessible website only proves that one outbound works. Maintenance is complete only when the logs show no Geo loading errors, fixed test requests connect, and direct and proxy destinations use the expected outbounds.

Download v2rayN