Sub-Store DNS 配置说明
背景:本文假设你十分熟悉 sub_store 相关配置,本配置只在 Singbox For Android 进行测试
核心思路
DNS 三层架构
┌─────────────────────────────────────────────────────────────┐
│ DNS 三层架构 │
├─────────────────────────────────────────────────────────────┤
│ Bootstrap 层(纯 IP ,无需解析,引导用) │
│ ├─ cn_bootstrap : UDP 223.5.5.5:53 (默认直连) │
│ └─ proxy_bootstrap: UDP 1.1.1.1:53 (走 Default 代理) │
├─────────────────────────────────────────────────────────────┤
│ 主 DNS 层( DoT 853 加密,按服务划分) │
│ ├─ cn_dns : 223.5.5.5 (直连) │
│ ├─ proxy_dns : 1.1.1.1 (走 Default) ← 兜底 │
│ ├─ paypal_dns : 8.8.8.8 (走 PayPal) │
│ ├─ ai_dns : 8.8.8.8 (走 AI-Service) │
│ ├─ tiktok_dns : 8.8.8.8 (走 TikTok) │
│ ├─ media_dns : 8.8.8.8 (走 Streaming-Media) │
│ ├─ telegram_dns : 8.8.8.8 (走 Telegram) │
│ ├─ instagram_dns: 8.8.8.8 (走 Instagram) │
│ └─ emby_dns : 8.8.8.8 (走 Emby) │
└─────────────────────────────────────────────────────────────┘
DNS 查询路由优先级
按优先级从高到低排列:
| 优先级 | 匹配场景 | 路由到 | 说明 |
|---|---|---|---|
| 1 | 节点链接 | cn_bootstrap |
节点服务器域名,最高优先级 |
| 2 | clash_mode=direct |
cn_dns |
全局直连模式 |
| 3 | clash_mode=global |
proxy_dns |
全局代理模式 |
| 4 | PayPal 域名 | paypal_dns |
走 PayPal 出口 |
| 5 | AI 服务域名 | ai_dns |
走 AI-Service 出口 |
| 6 | TikTok 域名 | tiktok_dns |
走 TikTok 出口 |
| 7 | 流媒体域名 | media_dns |
走 Streaming-Media 出口 |
| 8 | Telegram 域名 | telegram_dns |
走 Telegram 出口 |
| 9 | Instagram 域名 | instagram_dns |
走 Instagram 出口 |
| 10 | Emby / uhdnow.com |
emby_dns |
走 Emby 出口 |
| 11 | GFW 域名 | proxy_dns |
被墙域名走代理 |
| 12 | .cn / 国内站点 |
cn_dns |
国内域名直连解析 |
| 13 | 其他(兜底 final) |
proxy_dns |
加密 + 走代理 |
模板
https://files.catbox.moe/uw17zj.json
JS
https://files.catbox.moe/epcd2m.js
参考文献
https://github.com/LongLights/sing-box_template_merge_sub-store https://github.com/yyhhyyyyyy/selfproxy/tree/main/Sing-Box