折腾啥
Sub-Store 小课堂: 域名解析多 IP 裂变节点 群友的需求 使用了域名解析功能,如果有一个域名解析出来多个ip,如何让每个ip都变成一个节点 1. 如果你的真实需求是解析出不同运营商/不同地区的不同 IP 1.1 请把 Sub-Store 内置的域名解析这一步操作换成脚本操作, 内容为: const server = 'https://223.6.6.6/dns-query'; // DoH 阿里和腾讯的可能会触发限速 可以换别的试试 const edns = [{ name: '联通', ip:…
Sub-Store 小课堂: 域名解析多 IP 裂变节点更新

如果你的真实需求是解析出不同运营商/不同地区的不同 IP, 请把 Sub-Store 内置的域名解析这一步操作换成脚本操作, 内容为:
const server = 'https://223.6.6.6/dns-query'; // DoH
const edns = ['140.207.122.197', '183.47.126.35']; // 不同运营商/地区的 IP, 作为 EDNS Client Subnet (ECS)
const type = 'A'; // A 或 AAAA

if (!ProxyUtils.isIP($server.server)) {
const cache = scriptResourceCache;
const resolve = async (url, domain, type, edns) => {
const id = `${url}:${domain}:${type}:${edns}`;
const cached = cache.get(id);
// 使用缓存
if (cached) return cached;
const res = await ProxyUtils.doh({
url,
domain,
type,
edns,
});
const { answers } = res;
if (!Array.isArray(answers) || answers.length === 0) {
throw new Error('No answers');
}
const result = answers
.filter((i) => i?.type === type)
.map((i) => i?.data)
.filter((i) => i);
if (result.length === 0) {
throw new Error('No answers');
}
cache.set(id, result);
return result;
};
const result = await Promise.all(
edns.map((i) => resolve(server, $server.server, type, i)),
);
$server._resolved_ips = [...new Set(result.flat())];
}

然后接着用裂变脚本

原消息

Sub-Store 合集 频道资源合集 恰饭推荐 群组

#SubStore #Sub-Store #小课堂 #tips #域名解析 #裂变 #IP #节点