How to Update GeoIP and GeoSite Data Files: The Foundation of Routing Rules

Learn what geoip.dat and geosite.dat do, how to update them in popular clients, and how often to refresh them for accurate traffic routing.

At a glance

This guide is for users already routing traffic with v2rayN, v2rayNG, or v2flyNG who are seeing direct-connection sites go through a proxy, proxy domains connect directly, or ad-blocking rules miss targets. You will learn how GeoIP and GeoSite matching works, how to update or replace both files, how to verify the result, and how to set up a weekly maintenance routine.

What GeoIP and GeoSite Each Do

The V2Ray and Xray routing modules choose an outbound based on request characteristics. A connection may use a direct, proxy, or block outbound, with conditions typically based on the domain, destination IP, port, network type, and protocol. GeoSite and GeoIP are not node settings and do not establish VMess, VLESS, or other connections; they are classification data queried by routing rules.

geosite.dat stores domain categories. Expressions such as geosite:cn and geosite:category-ads-all look up their labels in this file. When a client receives a domain, it can match GeoSite first, so domain rules generally belong before rules that need the destination IP.

geoip.dat stores IP address-range categories. The common geoip:private rule identifies local-network and reserved addresses, while geoip:cn identifies ranges classified as being in mainland China. GeoIP is more likely to determine the outbound when no earlier domain rule matches or when the connection uses an IP address directly.

Application sends requestRead destination domainGeoSite matchResolve destination IPGeoIP matchChoose outbound

GeoSite domain categories

Data file
geosite.dat
Typical input
Full domain name
Common labels
geosite:cn
When matching occurs
Before domain resolution

Best for routing by site category; available labels depend on the current dataset.

GeoIP address categories

Data file
geoip.dat
Typical input
IPv4 or IPv6
Common labels
geoip:private
When matching occurs
After obtaining the destination IP

Best for connections that use an IP directly, and for follow-up decisions after domain rules.

Signs That the Data May Be Out of Date

Data files do not show an obvious “expired” status like subscribed nodes do. More often, connections still succeed but use the wrong outbound. For example, a newly added domain that should connect directly starts using a proxy, a newly assigned address range is not matched by geoip:cn, or a service whose classification changed is still handled according to its old category.

A single failed visit does not prove that Geo data is outdated. DNS responses, rule order, domain sniffing, node availability, and system proxy status can all affect the result. Check the destination domain, destination IP, and outboundTag in the client log first, then compare them with the rule-matching order.

2
Core data files
7 days
Routine check interval
1
Full restart after updating
3
Domain, IP, and outbound verification

Conclusion: Confirm the Match Before Updating

If the log contains a domain but no GeoSite match, check the label and rule order first. If matching has reached the IP stage but a new address range is uncategorized, prioritize updating geoip.dat. This prevents DNS or node failures from being mistaken for data problems.

Updating Geo Data Files in v2rayN

Using the common v2rayN 7.x interface as an example, the Geo data update controls are in the main window's update menu. Minor versions may show them as “Check for updates” or “Check for updates → Geo files,” but the goal is the same: download geoip.dat and geosite.dat compatible with the current core, then reload them in the core.

  1. First connect to a working node and make sure the v2rayN main-window log is not showing repeated connection timeouts.
  2. Open “Check for updates” → “Update Geo files” from the main menu. If your version shows a submenu, choose the option that updates both GeoIP and GeoSite.
  3. Wait for the interface or log to confirm that the download is complete. Do not close the program or start a second v2rayN instance during the update.
  4. When the update finishes, select “Restart service,” or exit v2rayN completely and reopen it so the Xray core reloads the data.
  5. Go to “Settings” → “Routing settings,” select the routing rule set in use, and confirm that its geosite: and geoip: labels have not changed spelling.

If the download times out, first check whether the update request must use the current proxy. In some network environments, the request succeeds only after enabling a working node and system proxy. If a normal proxy connection is already active but the update still fails, check the log to determine whether DNS resolution failed, the connection timed out, or writing the file was denied.

If a portable installation lacks write permission, the program may download a temporary file successfully but fail to replace data currently in use by the core. Exit the client completely, restart it, and try the update again. If it is installed in a protected directory, move it to a location your account can read and write instead of repeatedly clicking Update.

Checking for Updates in v2rayNG and v2flyNG

v2rayNG uses the Xray core, while v2flyNG uses the v2fly core; both can reference Geo data through routing settings. Android client menu names vary by version. Common paths include “Check for updates” in the main menu or “Settings” → “Geo files settings.” Check the download URL, current file status, and update action rather than changing only the routing rules.

v2rayNG checks

Platform
Android
Core
Xray
Location
Settings → Geo files settings
Update targets
GeoIP and GeoSite

After the update completes, stop the current connection and start the connection service again.

v2flyNG checks

Platform
Android
Core
v2fly
Location
Settings → Routing settings
Verification targets
Rule labels and file status

Choose data files compatible with v2fly routing syntax and the labels already in use.

  1. Stop the current connection, open the client settings, and find the entry for Geo files or routing data.
  2. Record the current routing mode and custom rules so the update does not accidentally switch the rule mode to another preset.
  3. Run the GeoIP and GeoSite updates, and wait until both tasks show as complete.
  4. Return to the main screen, reconnect to the node, and open the live log to check the routing results.

Android may restrict network activity after a client is sent to the background. Keep the client in the foreground until both files finish processing. If a large file is interrupted while the network switches between Wi-Fi and mobile data, return to a stable network and run the update again instead of using a partial file.

If a version has no separate update button, use the resource-management entry provided by that client version first. Although different cores can recognize common Geo data formats, their custom label sets may differ. Before using labels such as geosite:category-ads-all, confirm in the client log that they loaded successfully.

Manually Replacing geoip.dat and geosite.dat

When the built-in updater is unavailable, you can replace the data files manually. The key is not simply copying them into place, but confirming the directory that is actually in use. Desktop clients may store several core directories, and older directories may contain files with the same names. Replacing only the first search result may not affect the core currently running.

  1. Check the client log or core settings to confirm whether the active core is Xray or v2fly, then locate that core's actual program directory.
  2. Exit the client completely and make sure no core process remains in the background.
  3. Rename the existing geoip.dat and geosite.dat files as local backups so you can restore them if the new data is incompatible.
  4. Place the two new files in the same core resource directory, keeping their names lowercase and their extension as .dat.
  5. Reopen the client, check the startup log first, then test at least one GeoSite rule and one GeoIP rule.
Core resource directory/
├── geoip.dat
├── geosite.dat
└── Core executable

Routing reference example:
domain: geosite:cn
ip:     geoip:private
ip:     geoip:cn

If the client supports a custom resource directory, use the directory shown in its settings. Environment variables, startup arguments, and switching between multiple cores can all change where files are searched for. The most reliable check is to note the modification times of both files temporarily, restart, and see whether the log still reports missing old labels.

Ideally, both files should come from the same release cycle and be replaced during the same maintenance session. GeoIP and GeoSite do not need to share an identical internal version number, but mixing a long-outdated file with a new one makes troubleshooting harder: within one routing chain, the domain and IP stages may rely on data from different time periods.

How to Verify Routing After an Update

A successful-update message only proves that file processing finished; it does not prove that every rule matched as expected. Choose targets representing different branches: a local-network address, domains expected to connect directly, domains expected to use a proxy, and a connection that uses an IP directly. Keep the node, DNS, and system proxy settings unchanged during testing.

In v2rayN, open the main-window log and increase the log level if needed to observe the target, routing rule, and outbound tag. If a rule sends geosite:cn to direct, the corresponding domain should enter the direct outbound in the log. If the target appears directly as an IP, check whether geoip:private or geoip:cn matched.

Local-network address

Check whether it matches geoip:private.

If not, verify that the private-address rule comes before the default proxy rule.

Regular domain

Check whether the target GeoSite label matched.

If not, inspect domain sniffing, DNS, and label spelling.

IP entered directly

Check whether it entered the expected GeoIP branch.

If not, inspect the address-range category and rule order.

Uncategorized target

Check whether it entered the final default rule.

If not, verify that the default outbound is at the end of the rule list.

Rule order is the easiest factor to overlook after an update. V2Ray and Xray generally evaluate rules from top to bottom. A broad rule placed first can intercept a request early. For example, if “proxy all ports” comes before geosite:cn, the updated domain category later in the list never gets a chance to take effect.

Also distinguish between “no match” and “connection failed after a match.” The former calls for checking the data, labels, and rule order; the latter means an outbound was selected, so inspect the node connection, destination port, and DNS response instead. Both issues may look like a webpage failing to load, but they require completely different fixes.

Conclusion: Use outboundTag in the Log as the Acceptance Check

File modification times only show that a replacement occurred. Proper verification must use specific requests: which rule identified the domain or IP, and whether the request ultimately entered direct, proxy, or block. Testing three types of targets in succession reveals rule-order problems more reliably than repeatedly updating the files.

Update Frequency and Common Issues

Daily updates are unnecessary for typical use. Check every 7 days, or update after upgrading the client, changing routing rules, or repeatedly seeing new domains routed incorrectly. Replacing the files too often will not improve connection speed or node latency; Geo data only participates in classification.

Change only one variable at a time during maintenance. Update the Geo files and verify the result before changing DNS or routing rules. Keeping the same test targets and log level before and after the update lets you compare rule matches directly instead of judging by how a webpage feels.

All websites go through the proxy after the update?

Open “Settings” → “Routing settings” and check whether the default proxy rule has moved to the top of the list. Put precise GeoSite and GeoIP rules before broad rules, save, restart the core, and test again.

The log says a geosite label cannot be found?

Check the label spelling first, then confirm that the new geosite.dat contains that category. If the problem began after a manual replacement, restore the backup and restart rather than continuing to use an incompatible dataset.

GeoIP updated successfully, but routing did not change?

Confirm whether the test request uses an IP directly or has already matched an earlier domain rule. When GeoSite matches first, subsequent GeoIP rules do not participate in that outbound decision.

Do both files have to be updated together?

They can be replaced separately from a format perspective, but updating them in the same batch is recommended. Afterward, record both modification times and test one domain rule and one IP rule for each.

The update keeps timing out?

Connect to a working node first, then confirm that the system proxy or the client's proxy update option is enabled. If it still times out, inspect DNS and connection errors in the log instead of starting multiple update tasks in succession.

The goal of Geo data maintenance is to keep classification rules reasonably aligned with changes in the real network, not to make every request match a preset label. For domains that must always connect directly or always use a proxy, a clear custom domain rule is usually more controllable than waiting for a public category to update, and it should come before general Geo rules.

Download v2rayNView installers for four platforms