sing-box 在 iOS 中自定义的域名解析不了

8 天前
 lee88688

op 想使用 sing-box 在 iOS 手机上创建 vpn 然后连接家中公网 ip 暴露的 vmess 端口,家中的路由器自定义了一些域名,但是在 iOS 手机上访问域名无法打开家里面局域网的页面,直接使用 ip 访问却没问题,感觉应该是 DNS 解析出问题了。不过同样的配置( inbox 修改了一下,iOS 上使用 tun ,PC 上使用 http )在 PC 上测试了也是没问题,希望有了解的 V 友帮我解答一下,下面是我 iOS 上的配置文件

{
  "dns": {
    "servers": [
      {
        "tag": "local",
        "address": "local",
        "detour": "direct"
      },
      {
        "tag": "home-dns",
        "address": "192.168.0.1",
        "detour": "home"
      }
    ],
    "rules": [
      {
        "domain_suffix": "app.home",
        "server": "home-dns"
      }
    ],
    "strategy": "ipv4_only"
  },
  "inbounds": [
    {
      "type": "http",
      "tag": "http-in",
      "listen_port": 53530
    },
    {
      "type": "tun",
      "tag": "tun-in",
      "interface_name": "tun0",
      "inet4_address": "172.19.0.1/30",
      "auto_route": true,
      "strict_route": true,
      "stack": "gvisor",
      "sniff": true
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "direct-out"
    },
    {
      "tag": "home",
      "type": "vmess",
      "server": "server",
      "server_port": 10000,
      "uuid": "uuid",
      "alter_id": 0,
      "network": "tcp"
    }
  ],
  "route": {
    "rules": [
      {
        "ip_cidr": [
          "192.168.0.0/16"
        ],
        "outbound": "home"
      },
      {
        "domain_suffix": "app.home",
        "outbound": "home"
      }
    ],
    "final": "direct-out"
  }
}
714 次点击
所在节点    宽带症候群
4 条回复
afterain
8 天前
outbounds 中添加
{
"type": "dns",
"tag": "dns-out"
}

route rules 中添加
{
"protocol": "dns",
"outbound": "dns-out"
}
lee88688
8 天前
@afterain 请问一下,最新的文档中 protocol 已经没有 dns 选项了,而 dns 服务器配置中有一个 detour 选项,我是否可以这么理解,这个 detour 就是 outbounds 中的 dns type 的 tag ?
afterain
8 天前
lee88688
7 天前
按照目前我的版本 1.8.13 根据 @afterain 的改动后已经可以正常解析 dns 了。目前官方的文档应该和我的版本有所出入,所以有些配置问答不一样。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1052730

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX