V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lee88688
V2EX  ›  宽带症候群

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

  •  
  •   lee88688 · 6 天前 · 681 次点击

    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"
      }
    }
    
    4 条回复    2024-06-26 22:11:46 +08:00
    afterain
        1
    afterain  
       6 天前
    outbounds 中添加
    {
    "type": "dns",
    "tag": "dns-out"
    }

    route rules 中添加
    {
    "protocol": "dns",
    "outbound": "dns-out"
    }
    lee88688
        2
    lee88688  
    OP
       6 天前
    @afterain 请问一下,最新的文档中 protocol 已经没有 dns 选项了,而 dns 服务器配置中有一个 detour 选项,我是否可以这么理解,这个 detour 就是 outbounds 中的 dns type 的 tag ?
    lee88688
        4
    lee88688  
    OP
       5 天前
    按照目前我的版本 1.8.13 根据 @afterain 的改动后已经可以正常解析 dns 了。目前官方的文档应该和我的版本有所出入,所以有些配置问答不一样。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3462 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 10:37 · PVG 18:37 · LAX 03:37 · JFK 06:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.