Skip to content

Commit

Permalink
Update Domestic & Global Hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
SukkaW committed Oct 21, 2024
1 parent 17918f7 commit 28bcf76
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 31 deletions.
33 changes: 12 additions & 21 deletions Build/build-domestic-direct-lan-ruleset-dns-mapping-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});

Expand Down
5 changes: 3 additions & 2 deletions Source/non_ip/domestic.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
17 changes: 9 additions & 8 deletions Source/non_ip/domestic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export const DOMESTICS: Record<string, DNSMapping> = {
'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
Expand Down Expand Up @@ -175,13 +175,13 @@ export const DOMESTICS: Record<string, DNSMapping> = {
'+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'
]
},
Expand All @@ -198,6 +198,7 @@ export const DOMESTICS: Record<string, DNSMapping> = {
'+xiaomixiaoai.com', // only subdomains
'+mi-fds.com',
'+mifile.cn',
'+mijia.tech', // only subdomains
'miui.com',
'xiaomi.com',
'xiaomi.cn',
Expand Down Expand Up @@ -279,7 +280,7 @@ export const DOMESTICS: Record<string, DNSMapping> = {
'+shifen.com',
'+jomodns.com',
'+bdydns.com',
'+jomoxc.com',
'+jomoxc.com', // Baidu PCDN, of sort
'+duapp.com',
'+antpcdn.com' // Baidu PCDN
]
Expand Down
1 change: 1 addition & 0 deletions Source/non_ip/global.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 28bcf76

Please sign in to comment.