For readers who have imported a server and are ready to configure direct and proxy routing. Update the data files through the client, then confirm that your active routing rules reference the relevant groups. Test a domain, a private IP, and a request that matches no rule to determine whether a file failed to load, a rule failed to match, or traffic never reached the core.
What GeoIP and GeoSite Match
geoip.dat contains IP ranges organized by tags, while geosite.dat contains domain match entries organized by tags. These files provide rule data; they do not decide which outbound route traffic uses. Entries in the databases affect routing only when an active rule references the corresponding tag and specifies an outbound.
| Rule value | What it matches | Common misconception |
|---|---|---|
geosite:cn | Domain entries included in the cn group in the domain database | This does not include every domain ending in .cn; it may also include domains with other suffixes. |
geoip:cn | IP ranges classified under the cn group in the IP database | This matches IP addresses, not domain ownership. Whether a domain request is evaluated against IP rules also depends on the address the core receives and the DNS strategy in use. |
geoip:private | IP ranges classified under the private group in the IP database | Often used to send destinations such as local network devices directly, but it will not match based only on a device's local network hostname. |
Do not confuse subscription updates with routing database updates. A subscription update refreshes the server list; a Geo file update refreshes match data; changing outbounds or rule order modifies routing configuration. For example, after updating the database, the same geosite:cn rule may match more domains, but it still uses the outbound originally assigned to it.
Update Geo Data in v2rayN and v2rayNG
When the client provides a built-in update option, use it first. Menu names can vary slightly by version or interface language. The desktop steps below use the v2rayN 7 series main window; on Android, start from the v2rayNG sidebar.
Note Your Routing Setup
In v2rayN, open “Settings” → “Routing Settings” and note which profile is active. Check whether the rule list uses
geosite:orgeoip:. If you plan to edit rules as well, back up the current configuration first so you can roll back database updates and rule changes separately.Update the Desktop Data
In the v2rayN main window, open “Check for Updates” and select the Geo file update option. Wait for the result and confirm that both resources updated successfully; the progress window closing is not enough. If the list shows only application or core updates, do not mistake those for database updates.
Update the Android Data
In v2rayNG, open the top-left menu → “Geo Files” and use the update option on that page. Update both resources using the available method and check the result for each. A successful desktop update does not sync to your phone; seeing the same rule tags on both devices does not mean their database contents match.
Reload and Check
If the connection is still active after updating, disconnect and reconnect. On desktop, you can also close and reopen the client, then re-enable the same profile. Check the startup logs: a missing file and a missing tag are different problems. For a missing file, check its location and read permissions; for a missing tag, check whether the active database contains that group.
Built-In Client Updates
RecommendedUses the data source and file locations configured by the client. Retest with the existing routing profile after updating to keep the number of changed variables to a minimum.
Best for: routine maintenance and standard rule groups
Import or Replace Files Manually
Use this only when you need a specific group or built-in updates keep failing. On Android, use the import option provided by the app whenever possible. On desktop, first confirm where the running core reads its resources from. Stop the core, back up the original files, and replace them using the original filenames. Do not rename a different data file and assume it is a compatible version.
Best for: offline maintenance and custom groups as needed
Check the First Error Before Replacing the Database
If the log says a group does not exist, first check that the tag in the error matches the rule exactly. If the tag is correct, restore an older file that includes the group or edit the rule. Repeatedly updating the same data source will not add groups it never contained.
Route Private IPs and Domains Directly, with a Proxy Fallback
The following is a snippet of Xray's routing field, not a complete, standalone configuration. It assumes your existing outbound tags are direct and proxy; use the tags from your own configuration. If you use the client's graphical interface, add the matching conditions and outbounds one rule at a time in the routing editor. Do not paste this JSON into the subscription URL field.
{
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": ["geoip:private"],
"outboundTag": "direct"
},
{
"type": "field",
"domain": ["geosite:cn"],
"outboundTag": "direct"
},
{
"type": "field",
"network": "tcp,udp",
"outboundTag": "proxy"
}
]
}
}
- Put exceptions before the fallback: The core checks rules in order and selects an outbound as soon as a rule matches. If you move a rule matching both TCP and UDP to the top, the direct rules below it will never take effect. To send an internal company domain directly, add an explicit domain rule before the fallback.
- Use separate rules for domain and IP conditions: To match a domain in a specified group or an IP in a specified range, create two rules. Filling in both
domainandipin the samefieldrule does not make them alternatives. - Set your DNS strategy first:
AsIsdoes not resolve domain names just to apply IP-based routing. A direct request to a private IP can match the first rule, but you should not expect that rule to catch a request to the same device by hostname. WithIPIfNonMatch, a domain already caught by a general fallback rule on the first pass will not necessarily trigger a second IP match just because you changed the strategy.
Verify Routing with Three Requests
The IP ranges and sample ports below are common examples for testing, not measurements of database coverage or speed. Before testing a webpage, confirm that the app making the request actually sends traffic through the client. In particular, system proxy bypass lists may let local network addresses through directly. A page loading when the core received no connection does not prove that geoip:private matched.
- Test a private IP: Choose a local network device you are authorized to access and send a request to its actual IP address. If your test tool supports manual proxy settings, set the proxy type and port to v2rayN's current local inbound, and disable local network bypass for that test. The expected outbound is
direct. - Test a domain group: Choose a domain known to be in the
cngroup in your current data source, then make a new request using the domain name rather than entering its IP address. The expected outbound isdirect. If the logs show only an IP, check whether the app resolved the name locally and whether the active inbound passes the domain name to the core. - Test the fallback: Make a new connection to a test destination that is clearly outside the groups above. The expected outbound is
proxy. Test one destination per run. If the logs show outbound tags, match them by request time; do not mistake other domains loaded in the background for your test destination.
Troubleshooting Geo Updates and Routing
The update is stuck. Can I keep using the old rules?
First, check whether the error is a connection timeout or a write failure. For timeouts, check whether your current network can reach the resource source configured in the client. For write failures, check available storage and permissions on the resource directory. Keep any working old files. If only one file was replaced, restore both from your backup, reload, and retest the original routing setup.
I added geosite:cn. Why is a site still going through the proxy?
Check the active routing profile, rule order, and the exact domain used for the request. A site's main page, login endpoint, and static assets may use different domains. If only one specific domain needs a direct route, add an exact match for it before the fallback and test again; there is no need to replace the entire database.
My computer updated the files. Can I copy its configuration straight to Android?
You can carry over the intent of the rules, but do not use the entire configuration generated on desktop as an Android configuration. First update the Geo files on the device in v2rayNG, then check the tags in use, rule order, and which app traffic is covered. If per-app proxy selection is enabled, make sure the app you are testing is included.
Private IPs connect directly, but why can't I reach the device by name?
Test the IP address and device name in the same app. If only the name fails, check whether it resolves on your current network. If it resolves but uses the wrong outbound, add a separate direct routing rule for that name. Changing the outbound will not make a name that fails to resolve work.