Think of these files as two directories: one looks up domains, the other IP addresses. Updating them changes which destinations your rules can match; it does not change whether traffic is direct, proxied, or blocked. This guide is for anyone setting up routing rules, troubleshooting startup errors after an update, or figuring out why a website is taking the wrong route.
geoip.dat vs. geosite.dat
When you visit a website, the client may see a domain name or only an IP address. geosite.dat contains domain categories used to match domain-based routing conditions. geoip.dat contains IP range categories for IP-based conditions. Despite the geo in their names, not every category is based on geographic location: private addresses are grouped by purpose, not by region.
Domain-based matching: geosite.dat
Recommendedgeosite:cn looks up the cn domain list in the file currently in use. It is not shorthand for domains ending in “.cn”; matching depends on which entries the file contains. For services accessed by domain name, a domain rule is usually more direct than guessing where a service belongs based on an IP address returned by a single DNS lookup.
Best for: routing by website domain when the core can identify the destination domain.
IP range matching: geoip.dat
geoip:private looks up the private IP range list in the file currently in use. It checks which range the destination address belongs to, not the website’s name, and a match does not automatically select a direct route.
Best for: identifying specific private IP destinations, such as router admin addresses.
These are the three standard private IPv4 ranges, included to illustrate IP matching. They are not a complete list of everything that might be included in the private category in a given geoip.dat; the actual ranges depend on the file you load.
Check the destination, then choose a match type
If you only want your home router to use a direct connection and its admin address is 192.168.1.1, enter 192.168.1.1/32 as an IP condition. This matches just one address, so there’s no need to add the entire private range for a single exception.
Update Geo rule files in v2rayN
On desktop, keep “Update Geo files” separate from “Update subscription.” The first refreshes category data; the second fetches your server list. Refreshing a subscription does not also update Geo files. The steps below apply to configurations using Xray DAT routing data. If another core uses a different rule set, updating these files will not affect those rules.
Check which core is in use
In the v2rayN main window, check which server is selected, then go to “Settings” → “Parameter settings” → “Core type” to see the default core for that protocol. If the server has a core selected specifically for it, check the actual startup log. Note your current routing setup; there’s no need to switch servers just to update the files.
Update the rule files
In the main window, select “Check for updates” → “Update Geo files” (the menu may show “Update Geo files” in your language). Wait for the message area to report the result. If the update times out, fails to write, or downloads incompletely, troubleshoot that error first—opening the update menu does not mean the update succeeded.
Reload the current setup
Once the update is complete, restart the client so the current core reloads the rule data. Go to “Settings” → “Routing settings” and confirm the original setup is still selected. Updating the files won’t enable a different routing setup or add new categories to your existing rules.
Check the startup log
Check the message area in the main window to confirm the core started successfully. If a file can’t be found, check its location and permissions. If a category is missing, check whether that label exists in the data source you’re using. Keep the original error message; it’s more useful for troubleshooting than repeatedly clicking Update.
Update Geo assets in v2rayNG
The steps on Android differ from desktop. Open the v2rayNG side menu and select “Geo assets” to view and update geoip.dat and geosite.dat. Depending on the version, the update option may be in the menu at the top right or alongside each asset. Check the page title and file names; don’t look for a download button under “Subscription group settings.”
- Reconnect after updating: Wait for the asset page to confirm the operation is complete, then return to the main screen and stop and restart the connection. An existing connection staying up doesn’t tell you whether the core has loaded the new data.
- Check which step failed: The two files may not update successfully at the same time. If one download fails, check your connection or whether the selected source is available. Don’t overwrite it with a file from an unfamiliar source just because it has the same name.
- Keep your existing routing conditions: If you use custom routing, note which categories your rules rely on. If a category is missing after changing sources, switch back to a source that worked or edit only the rule that references it. There’s no need to reset the entire client.
Where to use geosite:cn and geoip:private
In v2rayN, go to “Settings” → “Routing settings” and edit the setup currently in use. Put geosite:cn in the domain condition and geoip:private in the IP condition. Choose the outbound separately to suit your needs. The Xray snippets below are two standalone examples showing which fields to use; direct must match an existing direct outbound tag in your configuration. These snippets are not complete configurations and should not replace existing files.
[
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "direct"
},
{
"type": "field",
"domain": ["geosite:cn"],
"outboundTag": "direct"
}
]
- Use separate rules for either/or conditions: In Xray, putting both domain and IP conditions in one rule usually requires both to match; it does not mean either one is enough. To match each type of destination independently, split them into two rules as shown in the snippets.
- Put specific exceptions before broad rules: The core uses the first matching rule in order. If an earlier, broader rule already catches a domain, a later exception for that domain won’t take effect.
- Don’t confuse DNS resolution with category updates:
AsIsdoes not actively resolve the destination domain for IP-based routing matches.IPIfNonMatchallows the core to resolve the domain and try IP conditions if nothing has matched yet. If a domain rule matches earlier, the core won’t resolve the domain again to try a later IP rule.
Common issues after updating
The update succeeded, so why is the website still using the old route?
First, confirm that the routing setup you edited is the one currently in use. Then disconnect the old connection and make a new request. Check the rule order: if an earlier domain rule already matches, you’ll need to move or narrow that rule to change the result. Also confirm that the app’s traffic is actually going through the client; requests that bypass the core won’t be routed here.
The log says a category is missing. Does that mean the file didn’t download?
Not necessarily. If the log names a Geo category rather than saying the file couldn’t be opened, first check the label spelling and the source of the current file. Files with the same name can contain different groups. Switch back to a data source known to include the label, or update the rule to use a label that exists in your data, then restart the connection and test again.
Why doesn’t geosite:cn match when I connect using an IP address?
When you enter an IP address directly, there’s no destination domain for this rule to match. Try making another request to the same service using its actual domain and compare the results. If you need to route that IP separately, use an IP condition instead of adding another domain category.
Why can’t devices on my local network connect after the update?
First, check the device’s current admin address, then test whether you can reach it from the same local network. If the request passes through the core, check that the private address rule selects a direct outbound and isn’t being caught by an earlier rule. A direct route only determines where the request is sent from; it can’t fix a mistyped address, an offline device, or network isolation.