From 28bcf766b516851fa668d6984cf13ed6198d9d96 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Tue, 22 Oct 2024 00:28:22 +0800 Subject: [PATCH] Update Domestic & Global Hosts --- ...c-direct-lan-ruleset-dns-mapping-module.ts | 33 +++++++------------ Source/non_ip/domestic.conf | 5 +-- Source/non_ip/domestic.ts | 17 +++++----- Source/non_ip/global.conf | 1 + 4 files changed, 25 insertions(+), 31 deletions(-) diff --git a/Build/build-domestic-direct-lan-ruleset-dns-mapping-module.ts b/Build/build-domestic-direct-lan-ruleset-dns-mapping-module.ts index e347f3cce..a1dd86b0f 100644 --- a/Build/build-domestic-direct-lan-ruleset-dns-mapping-module.ts +++ b/Build/build-domestic-direct-lan-ruleset-dns-mapping-module.ts @@ -118,30 +118,21 @@ export const buildDomesticRuleset = task(require.main === module, __filename)(as const { domains, dns, hosts } = cur; Object.entries(hosts).forEach(([dns, ips]) => { - if (!(dns in acc)) { - acc[dns] = ips.join(', '); - } + acc[dns] ||= ips.join(', '); }); domains.forEach((domain) => { - if (domain[0] === '$') { - const d = domain.slice(1); - if (!(d in acc)) { - acc[d] = `server:${dns}`; - } - } else if (domain[0] === '+') { - const d = `*.${domain.slice(1)}`; - if (!(d in acc)) { - acc[d] = `server:${dns}`; - } - } else { - if (!(domain in acc)) { - acc[domain] = `server:${dns}`; - } - const d = `*.${domain}`; - if (!(d in acc)) { - acc[d] = `server:${dns}`; - } + switch (domain[0]) { + case '$': + acc[domain.slice(1)] ||= `server:${dns}`; + break; + case '+': + acc[`*.${domain.slice(1)}`] ||= `server:${dns}`; + break; + default: + acc[domain] ||= `server:${dns}`; + acc[`*.${domain}`] ||= `server:${dns}`; + break; } }); diff --git a/Source/non_ip/domestic.conf b/Source/non_ip/domestic.conf index e21e78bad..e33315954 100644 --- a/Source/non_ip/domestic.conf +++ b/Source/non_ip/domestic.conf @@ -55,6 +55,7 @@ DOMAIN-SUFFIX,hwht.com # >> Meizu DOMAIN-SUFFIX,flyme.cn +DOMAIN-SUFFIX,flyme.com DOMAIN-SUFFIX,meizu.cn DOMAIN-SUFFIX,meizu.com DOMAIN-SUFFIX,mzres.com @@ -207,7 +208,6 @@ DOMAIN-SUFFIX,sinaapp.com DOMAIN-SUFFIX,sinaedge.com DOMAIN-SUFFIX,sinaimg.cn DOMAIN-SUFFIX,sinaimg.com -DOMAIN-SUFFIX,sinajs.com DOMAIN-SUFFIX,sinajs.cn DOMAIN-SUFFIX,sinajs.com DOMAIN-SUFFIX,t.cn @@ -364,6 +364,7 @@ DOMAIN-SUFFIX,ubnt.com.cn DOMAIN-SUFFIX,gov.cn DOMAIN-SUFFIX,edu.cn DOMAIN-SUFFIX,org.cn +DOMAIN-SUFFIX,com.cn DOMAIN,cn.download.nvidia.com DOMAIN-SUFFIX,jetbrains.com.cn @@ -392,6 +393,7 @@ DOMAIN-SUFFIX,66law.cn DOMAIN-SUFFIX,88.com DOMAIN-SUFFIX,88y.cn DOMAIN-SUFFIX,9game.cn +DOMAIN-SUFFIX,9xiu.com DOMAIN-SUFFIX,aicdn.com DOMAIN-SUFFIX,aicoinstorge.com DOMAIN-SUFFIX,air-matters.com @@ -524,7 +526,6 @@ DOMAIN-SUFFIX,ludashi.com DOMAIN-SUFFIX,luojilab.com DOMAIN-SUFFIX,m1905.cn DOMAIN-SUFFIX,m1905.com -DOMAIN-SUFFIX,maoyan.com DOMAIN-SUFFIX,maoyun.tv DOMAIN-SUFFIX,mcdonalds.com.cn DOMAIN-SUFFIX,mihayo.com diff --git a/Source/non_ip/domestic.ts b/Source/non_ip/domestic.ts index 92ac81515..b5e3de7a7 100644 --- a/Source/non_ip/domestic.ts +++ b/Source/non_ip/domestic.ts @@ -105,8 +105,8 @@ export const DOMESTICS: Record = { 'qq.com', 'qq.com.cn', // 'qq.wang', - 'qqmail.cn', - 'qqmail.com', + // 'qqmail.cn', // not owned by QQ, is sold on hichina.com + '+qqmail.com', 'qzone.com', '+tencent-cloud.net', '+tencent-cloud.com', // apex doain resolve to 0.0.0.1 by DNSPod public DNS @@ -175,13 +175,13 @@ export const DOMESTICS: Record = { '+biliimg.com', '+biliapi.com', '+biliapi.net', - 'biligame.cn', + // 'biligame.cn', // not owned by bilibili, was put on sale by ename 'biligame.com', - 'biligame.net', + '+biligame.net', // subdomain only 'bilicomic.com', - 'bilicomics.com', - 'bilibilipay.cn', - 'bilibilipay.com', + 'bilicomics.com', // m wap version of bilicomic + // 'bilibilipay.cn', // not owned by bilibili + // 'bilibilipay.com', // not owned by bilibili '+bilicdn1.com' ] }, @@ -198,6 +198,7 @@ export const DOMESTICS: Record = { '+xiaomixiaoai.com', // only subdomains '+mi-fds.com', '+mifile.cn', + '+mijia.tech', // only subdomains 'miui.com', 'xiaomi.com', 'xiaomi.cn', @@ -279,7 +280,7 @@ export const DOMESTICS: Record = { '+shifen.com', '+jomodns.com', '+bdydns.com', - '+jomoxc.com', + '+jomoxc.com', // Baidu PCDN, of sort '+duapp.com', '+antpcdn.com' // Baidu PCDN ] diff --git a/Source/non_ip/global.conf b/Source/non_ip/global.conf index a515ad699..9ff9b6b75 100644 --- a/Source/non_ip/global.conf +++ b/Source/non_ip/global.conf @@ -372,6 +372,7 @@ DOMAIN-SUFFIX,aaa.com DOMAIN-SUFFIX,abc.net.au DOMAIN-SUFFIX,acg.mn DOMAIN-SUFFIX,acg.rip +DOMAIN-SUFFIX,adguard.com DOMAIN-SUFFIX,afraid.org DOMAIN-SUFFIX,ajay.app DOMAIN-SUFFIX,akamai.net