SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
15.38k stars 1.89k forks source link

win7环境使用sing-box客户端,dns没法远程解析,请帮忙看看是不是配置文件配的有问题 #1855

Closed mebest100 closed 1 week ago

mebest100 commented 2 weeks ago

Operating system

Windows

System version

win7 64

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

sing-box version 1.10.0-alpha.11

Environment: go1.20.14 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_reality_serv
er,with_acme,with_clash_api
Revision: 400cb5d7a395b369a5b4adbf90965819aed1763c
CGO: disabled

Description

win7环境使用sing-box客户端,dns没法远程解析,请帮忙看看是不是配置文件配的有问题,

配置文件如下:

{
    "log": {
        "level": "info",
        "timestamp": true
    },
    "dns": {      
        "independent_cache": true,
        "rules": [
            {
                "outbound": [
                    "any"
                ],
                "server": "local"
            },
            {
                "disable_cache": true,
                "rule_set": [
                    "AdGuardSDNSFilter",
                    "chrome-doh"
                ],
                "server": "block"
            },
            {
                 "clash_mode": "global",
                "server": "remote"
            },

            {
                "clash_mode": "direct",
                "server": "local"
            },
            {
                "rule_set": "geosite-cn",
                "server": "local"
            }
        ],
        "servers": [
            {
                "address": "https://1.1.1.1/dns-query",
                "detour": "select",
                "tag": "remote"
            },
            {
                "address": "https://223.5.5.5/dns-query",
                "detour": "direct",
                "tag": "local"
            },
            {
                "address": "rcode://success",
                "tag": "block"
            }
        ],
        "strategy": "prefer_ipv4"
    },
    "experimental": {
        "cache_file": {
            "enabled": true
        },
        "clash_api": {
            "external_controller": "127.0.0.1:9090",
            "secret": ""
        }
    },

    "inbounds": [
         {
            "domain_strategy": "prefer_ipv4",
            "listen": "127.0.0.1",
            "listen_port": 2333,
            "tag": "socks-in",
            "type": "socks",
            "users": []
        },
        {
            "domain_strategy": "prefer_ipv4",
            "listen": "127.0.0.1",
            "listen_port": 2334,
            "tag": "mixed-in",
            "type": "mixed",
            "users": []
        }
    ],
    "outbounds": [   
     {
            "tag": "select",
            "type": "selector",
            "default": "TuicV5",
            "outbounds": [
                "TuicV5"
            ]
        },

        {
            "tag": "TuicV5",
            "type": "tuic",
            "server": "xxxxx",
            "server_port": xxxx,
            "uuid": "xxxxxxx",
            "password": "xxxxxxxxxx",           
            "congestion_control": "bbr",
            "tls": {
                "enabled": true,
                "server_name": "xxxxx",
                "alpn": ["h3"]
            }
        },
        {
            "type": "direct",
            "tag": "direct"
        },
        {
            "type": "block",
            "tag": "block"
        },
        {
            "type": "dns",
            "tag": "dns-out"
        }
    ],
    "route": {
        "auto_detect_interface": true,
        "rule_set": [
            {
                "format": "binary",
                "tag": "geoip-cn",
                "type": "local",
                "path": "./geoip-cn.srs"
            },
            {
                "format": "binary",
                "tag": "geosite-cn",
                "type": "local",
                "path": "./geosite-geolocation-cn.srs"
            },
            {
                "format": "binary",
                "tag": "AdGuardSDNSFilter",
                "type": "local",
                "path": "./AdGuardSDNSFilter.srs"
            },
            {
                "format": "source",
                "tag": "chrome-doh",
                "type": "local",
                "path": "./chrome-doh.json"
            }
        ],
        "rules": [
            {
                "outbound": "dns-out",
                "protocol": "dns"
            },
            {
                "clash_mode": "direct",
                "outbound": "direct"
            },
            {
                "clash_mode": "global",
                "outbound": "select"
            },
            {
                "ip_is_private": true,
                "outbound": "direct"
            },
            {
                "outbound": "direct",
                "rule_set": "geoip-cn"
            }
        ]
    }

}

Reproduction

image

Logs

No response

Supporter

Integrity requirements

dyhkwong commented 1 week ago

Maybe it's caused by golang/go#37176, see MetaCubeX/mihomo@b840eae.

mebest100 commented 1 week ago

Maybe it's caused by golang/go#37176, see MetaCubeX/mihomo@b840eae.

But if with tun , it works, I don't know if tun is MUST for sing-box client config. If so, it's no meaningful for inbound socks/http listen config. And all dns config seems work from locally not remotely in singbox, that's to say there is no mechnism of dns remote resolve for sing-box