From f6779342579b697f6420341ec382924203516821 Mon Sep 17 00:00:00 2001 From: MkQtS <81752398+MkQtS@users.noreply.github.com> Date: Wed, 12 Nov 2025 19:08:36 +0800 Subject: [PATCH] Proxy all Google domains (#8287) * Proxy all Google domains Default geosite-cn(dat/srs) used by v2rayN contains google@cn, which performs poorly in certain user environments. * Resolve all Google domains via remote server * fix typo * Add google to default geofiles --- package-rhel.sh | 2 +- v2rayN/ServiceLib/Sample/custom_routing_black | 15 +++++++-------- v2rayN/ServiceLib/Sample/custom_routing_white | 15 +++++++-------- v2rayN/ServiceLib/Sample/dns_singbox_normal | 5 ++--- v2rayN/ServiceLib/Sample/dns_v2ray_normal | 3 +-- v2rayN/ServiceLib/Sample/tun_singbox_dns | 5 ++--- v2rayN/ServiceLib/Services/UpdateService.cs | 1 + 7 files changed, 21 insertions(+), 25 deletions(-) diff --git a/package-rhel.sh b/package-rhel.sh index b93ea82c..5ef75ab5 100644 --- a/package-rhel.sh +++ b/package-rhel.sh @@ -458,7 +458,7 @@ download_geo_assets() { "https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geoip/$f" || true done for f in \ - geosite-cn.srs geosite-gfw.srs geosite-greatfire.srs \ + geosite-cn.srs geosite-gfw.srs geosite-google.srs geosite-greatfire.srs \ geosite-geolocation-cn.srs geosite-category-ads-all.srs geosite-private.srs; do curl -fsSL -o "$srss_dir/$f" \ "https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geosite/$f" || true diff --git a/v2rayN/ServiceLib/Sample/custom_routing_black b/v2rayN/ServiceLib/Sample/custom_routing_black index ff2aa075..41fbdfaa 100644 --- a/v2rayN/ServiceLib/Sample/custom_routing_black +++ b/v2rayN/ServiceLib/Sample/custom_routing_black @@ -13,20 +13,19 @@ "api.ip.sb" ] }, - { - "remarks": "Google cn", - "outboundTag": "proxy", - "domain": [ - "domain:googleapis.cn", - "domain:gstatic.com" - ] - }, { "remarks": "阻断udp443", "outboundTag": "block", "port": "443", "network": "udp" }, + { + "remarks": "代理Google", + "outboundTag": "proxy", + "domain": [ + "geosite:google" + ] + }, { "remarks": "绕过局域网IP", "outboundTag": "direct", diff --git a/v2rayN/ServiceLib/Sample/custom_routing_white b/v2rayN/ServiceLib/Sample/custom_routing_white index 10dae092..4f8540fe 100644 --- a/v2rayN/ServiceLib/Sample/custom_routing_white +++ b/v2rayN/ServiceLib/Sample/custom_routing_white @@ -1,18 +1,17 @@ [ - { - "remarks": "Google cn", - "outboundTag": "proxy", - "domain": [ - "domain:googleapis.cn", - "domain:gstatic.com" - ] - }, { "remarks": "阻断udp443", "outboundTag": "block", "port": "443", "network": "udp" }, + { + "remarks": "代理Google", + "outboundTag": "proxy", + "domain": [ + "geosite:google" + ] + }, { "remarks": "绕过局域网IP", "outboundTag": "direct", diff --git a/v2rayN/ServiceLib/Sample/dns_singbox_normal b/v2rayN/ServiceLib/Sample/dns_singbox_normal index b32b439c..2df81395 100644 --- a/v2rayN/ServiceLib/Sample/dns_singbox_normal +++ b/v2rayN/ServiceLib/Sample/dns_singbox_normal @@ -14,9 +14,8 @@ ], "rules": [ { - "domain_suffix": [ - "googleapis.cn", - "gstatic.com" + "rule_set": [ + "geosite-google" ], "server": "remote", "strategy": "prefer_ipv4" diff --git a/v2rayN/ServiceLib/Sample/dns_v2ray_normal b/v2rayN/ServiceLib/Sample/dns_v2ray_normal index fdb30dae..867bb646 100644 --- a/v2rayN/ServiceLib/Sample/dns_v2ray_normal +++ b/v2rayN/ServiceLib/Sample/dns_v2ray_normal @@ -8,8 +8,7 @@ "address": "1.1.1.1", "skipFallback": true, "domains": [ - "domain:googleapis.cn", - "domain:gstatic.com" + "geosite:google" ] }, { diff --git a/v2rayN/ServiceLib/Sample/tun_singbox_dns b/v2rayN/ServiceLib/Sample/tun_singbox_dns index 3dd55eef..4f91c6ff 100644 --- a/v2rayN/ServiceLib/Sample/tun_singbox_dns +++ b/v2rayN/ServiceLib/Sample/tun_singbox_dns @@ -14,9 +14,8 @@ ], "rules": [ { - "domain_suffix": [ - "googleapis.cn", - "gstatic.com" + "rule_set": [ + "geosite-google" ], "server": "remote", "strategy": "prefer_ipv4" diff --git a/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayN/ServiceLib/Services/UpdateService.cs index fc636c60..d71719a0 100644 --- a/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayN/ServiceLib/Services/UpdateService.cs @@ -396,6 +396,7 @@ public class UpdateService(Config config, Func updateFunc) } //append dns items TODO + geoSiteFiles.Add("google"); geoSiteFiles.Add("cn"); geoSiteFiles.Add("geolocation-cn"); geoSiteFiles.Add("category-ads-all");