sing-box
sing-box copied to clipboard
某些国内域名dns解析失败,导致无法访问
操作系统
macOS
系统版本
15.6.1 (24G90)
安装类型
sing-box for macOS 图形客户端程序
如果您使用图形客户端程序,请提供该程序版本。
版本1.12.4 (1)
版本
描述
dns无法解析国内h5.gantanhao.com这个域名
重现方式
# 启用sing-box
~ dig +short h5.gantanhao.com // 输出结果为空
# 关闭sing-box
~ dig +short h5.gantanhao.com // 输出结果如下
t4zbwsq9.zgjn.qwe68.cn.
111.170.164.248
111.170.163.167
211.154.24.16
211.101.235.155
配置文件如下:
{
"log": {
"disabled": false,
"level": "debug",
"timestamp": true,
"output": ""
},
"dns": {
"servers": [
{
"type": "local",
"tag": "local-dns",
"detour": "DIRECT"
},
{
"type": "fakeip",
"tag": "fakeip",
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/18"
},
{
"type": "udp",
"tag": "cloudflare-udp",
"server": "1.1.1.1",
"detour": "hk"
}
],
"rules": [
{
"query_type": "DNSKEY",
"action": "predefined",
"rcode": "NOERROR"
},
{
"clash_mode": "direct",
"server": "local-dns",
"strategy": "prefer_ipv6"
},
{
"clash_mode": "global",
"server": "cloudflare-udp",
"strategy": "prefer_ipv6"
},
{
"rule_set": "geosite-cn",
"server": "local-dns",
"strategy": "prefer_ipv6"
},
{
"rule_set": "geosite-geolocation-!cn",
"server": "fakeip",
"strategy": "prefer_ipv6"
}
],
"final": "cloudflare-udp",
"strategy": "prefer_ipv6"
},
"route": {
"rules": [
{
"inbound": "tun-in",
"action": "sniff",
"timeout": "1s"
},
{
"type": "logical",
"mode": "or",
"rules": [
{
"network": "udp",
"port": 53
},
{
"protocol": "dns"
}
],
"action": "hijack-dns"
},
{
"clash_mode": "direct",
"outbound": "DIRECT"
},
{
"clash_mode": "global",
"outbound": "PROXY"
},
{
"rule_set": [
"geoip-cn",
"geosite-cn"
],
"outbound": "DIRECT"
},
{
"rule_set": "geosite-geolocation-!cn",
"outbound": "PROXY"
}
],
"rule_set": [
{
"type": "remote",
"tag": "geoip-cn",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
"download_detour": "PROXY"
},
{
"type": "remote",
"tag": "geosite-cn",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs",
"download_detour": "PROXY"
},
{
"type": "remote",
"tag": "geosite-geolocation-!cn",
"url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
"download_detour": "PROXY"
}
],
"final": "PROXY",
"auto_detect_interface": true,
"default_domain_resolver": "cloudflare-udp"
},
"inbounds": [
{
"type": "tun",
"tag": "tun-in",
"mtu": 9000,
"address": [
"172.19.0.1/30",
"fdfe:dcba:9876::1/126"
],
"auto_route": true,
"strict_route": true,
"stack": "mixed"
}
],
"outbounds": [
{
"type": "direct",
"tag": "DIRECT"
},
{
"type": "vless",
"tag": "hk",
"server": "",
"server_port": 443,
"uuid": "",
"flow": "",
"tls": {
"enabled": true,
"server_name": "",
"utls": {
"enabled": true,
"fingerprint": ""
},
"reality": {
"enabled": true,
"public_key": ""
}
}
},
{
"type": "selector",
"tag": "PROXY",
"outbounds": [
"hk"
]
}
]
}
日志
+0800 2025-09-08 19:01:33 INFO network: updated available networks: en0 (wifi)
+0800 2025-09-08 19:01:33 INFO network: updated default interface en0, index 10, type wifi
+0800 2025-09-08 19:01:33 INFO inbound/tun[tun-in]: started at utun5
+0800 2025-09-08 19:01:33 INFO sing-box started (0.188s)
...
+0800 2025-09-08 19:01:35 DEBUG [2289233959 0ms] dns: exchange h5.gantanhao.com. IN A
+0800 2025-09-08 19:01:35 DEBUG [2414723168 0ms] dns: exchange h5.gantanhao.com. IN AAAA
...
+0800 2025-09-08 19:01:43 ERROR [2414723168 8.20s] dns: exchange failed for h5.gantanhao.com. IN AAAA: context deadline exceeded
+0800 2025-09-08 19:01:43 ERROR [2289233959 8.20s] dns: exchange failed for h5.gantanhao.com. IN A: context deadline exceeded
...
+0800 2025-09-08 19:01:48 DEBUG [2414723168 12.73s] dns: exchanged h5.gantanhao.com SERVFAIL 0
+0800 2025-09-08 19:01:48 DEBUG [2289233959 13.22s] dns: exchange h5.gantanhao.com. IN A
+0800 2025-09-08 19:01:48 DEBUG [2289233959 13.23s] dns: exchanged h5.gantanhao.com SERVFAIL 0
+0800 2025-09-08 19:01:48 DEBUG [2289233959 13.31s] dns: exchanged h5.gantanhao.com SERVFAIL 0
支持我们
- [ ] 我已经 赞助
完整性要求
- [x] 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
- [x] 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
- [x] 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
- [x] 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。