SagerNet / sing-box

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

singbox安卓客户端dns解析出来的ipv6地址 #1399

Closed bettswang closed 9 months ago

bettswang commented 10 months ago

Operating system

供应商

System version

供应商

Installation type

Original sing-box Command Line

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

1.8.2

Version

No response

Description

在使用安卓客户端下,虽然dns有解析出目标服务器的ipv4和ipv6地址。但是在emby节点下,却一直强制使用ipv6去连接,导致链接失败。下以下是部分配置和日志。

{
    "dns": {
        "servers": [
            {
                "tag": "google",
                "address": "tls:\/\/8.8.4.4",
                "address_strategy": "prefer_ipv4",
                "detour": "\ud83d\udde1\ufe0f DNS"
            },
            {
                "tag": "outbound-dns",
                "address": "https:\/\/223.6.6.6\/dns-query",
                "address_strategy": "prefer_ipv4",
                "detour": "\ud83e\udea2 \u76f4\u8fde"
            },
            {
                "tag": "local",
                "address": "https:\/\/223.6.6.6\/dns-query",
                "address_strategy": "prefer_ipv4",
                "detour": "\ud83e\udea2 \u76f4\u8fde"
            },
            {
                "tag": "fakedns",
                "address": "fakeip"
            }
        ],
        "rules": [
            {
                "outbound": "any",
                "server": "outbound-dns",
                "disable_cache": true
            },
            {
                "clash_mode": "\ud83e\udea2 \u76f4\u8fde",
                "server": "local"
            },
            {
                "clash_mode": "\ud83d\udd10 \u5168\u5c40",
                "server": "google"
            },
            {
                "domain_keyword": "ntp",
                "server": "local"
            },
            {
                "rule_set": [
                    "ruleset-chinamax",
                    "geoip-cn",
                    "geosite-cn",
                    "geosite-apple@cn",
                    "geosite-category-games@cn",
                    "geosite-private"
                ],
                "server": "local"
            },
            {
                "query_type": [
                    "A",
                    "AAAA"
                ],
                "rule_set": "geosite-geolocation-!cn",
                "server": "google"
            },
            {
                "rule_set": "geosite-geolocation-!cn",
                "server": "google"
            }
        ],
        "final": "local",
        "reverse_mapping": true,
        "independent_cache": true,
        "fakeip": {
            "enabled": true,
            "inet4_range": "198.18.0.0\/15",
            "inet6_range": "fc00::\/18"
        }
    },
    "route": {
        "rules": [
            {
                "port": 53,
                "outbound": "dns-out"
            },
            {
                "clash_mode": "\ud83e\udea2 \u76f4\u8fde",
                "outbound": "\ud83e\udea2 \u76f4\u8fde"
            },
            {
                "clash_mode": "\ud83d\udd10 \u5168\u5c40",
                "outbound": "\ud83d\udd10 \u5168\u5c40"
            },
            {
                "domain": [
                    "steamcdn-a.akamaihd.net"
                ],
                "domain_suffix": [
                    "speedtest.net",
                    "steamserver.net"
                ],
                "outbound": "\ud83e\udea2 \u76f4\u8fde"
            },
            {
                "rule_set": [
                    "ruleset-telegram"
                ],
                "outbound": "\ud83d\udcad Telegram"
            },
            {
                "rule_set": [
                    "ruleset-netflix",
                    "geosite-disney",
                    "geosite-bahamut"
                ],
                "outbound": "\ud83c\udfd9\ufe0f \u6d41\u5a92\u4f53"
            },
            {
                "rule_set": [
                    "ruleset-emby"
                ],
                "outbound": "\ud83c\udf5f EMBY"
            },
            {
                "rule_set": [
                    "geosite-spotify"
                ],
                "outbound": "\ud83c\udfb5 Spotify"
            },
            {
                "rule_set": [
                    "geosite-bilibili"
                ],
                "outbound": "\ud83c\udd71\ufe0f Bilibili"
            },
            {
                "rule_set": [
                    "geosite-openai"
                ],
                "outbound": "\u2754 OpenAI"
            },
            {
                "rule_set": [
                    "geosite-onedrive"
                ],
                "outbound": "\u2601\ufe0f Onedrive"
            },
            {
                "rule_set": [
                    "geosite-apple"
                ],
                "outbound": "\ud83c\udf4e Apple"
            },
            {
                "rule_set": [
                    "geoip-cn",
                    "geosite-cn"
                ],
                "outbound": "\ud83e\udea2 \u76f4\u8fde"
            },
            {
                "rule_set": "geosite-geolocation-!cn",
                "outbound": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            }
        ],
        "rule_set": [
            {
                "tag": "ruleset-chinamax",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/shangguanhongxin\/for-sing-box-and-surge\/master\/sing-box\/ChinaMax\/ChinaMax_All.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geoip-cn",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/MetaCubeX\/meta-rules-dat\/sing\/geo\/geoip\/cn.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-cn",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-cn.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-apple@cn",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-apple@cn.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-category-games@cn",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-category-games@cn.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-private",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-private.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-geolocation-!cn",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-geolocation-!cn.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "ruleset-telegram",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/shangguanhongxin\/for-sing-box-and-surge\/master\/sing-box\/Telegram\/Telegram.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "ruleset-netflix",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/shangguanhongxin\/for-sing-box-and-surge\/master\/sing-box\/Netflix\/Netflix.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-disney",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-disney.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-bahamut",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-bahamut.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "ruleset-emby",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/NotSFC\/rulelist\/main\/sing-box\/Emby\/Emby.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-spotify",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-spotify.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-bilibili",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-bilibili.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-openai",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-openai.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-onedrive",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-onedrive.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            },
            {
                "tag": "geosite-apple",
                "type": "remote",
                "format": "binary",
                "url": "https:\/\/raw.githubusercontent.com\/CHIZI-0618\/v2ray-rules-dat\/release\/singbox_rule_set\/geosite-apple.srs",
                "download_detour": "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc"
            }
        ],
        "final": "\ud83e\uddec \u515c\u5e95",
        "auto_detect_interface": true
    },
    "outbounds": [
        {
            "tag": "\ud83c\udf5f EMBY",
            "type": "selector",
            "outbounds": [
                "\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f \u79c1\u623f\u83dc",
                "\u2728 \u81ea\u52a8\u9009\u62e9",
                "\ud83d\udcdd \u8ba2\u9605IP\uff1a120.41.*.*",
                "\ud83d\udcdd ISP\uff1a\u798f\u5efa\u53a6\u95e8-\u7535\u4fe1",
                "\ud83d\udcdd \u6d41\u91cf\uff1a15.07 \/ 200 GB",
                "\ud83d\udcdd \u91cd\u7f6e\uff1a23 \u5929",
                "\ud83d\udcdd \u5230\u671f\uff1a2024.02.15 15:21:09",
                "\ud83c\udded\ud83c\uddf0 HK1 CM",
                "\ud83c\udded\ud83c\uddf0 HK2 CM",
                "\ud83c\udded\ud83c\uddf0 HK3 CM",
                "\ud83c\udded\ud83c\uddf0 HK4 CM",
                "\ud83d\udcfa EMBY 0.01x",
                "\ud83c\udded\ud83c\uddf0 HK HKT HOME 1.5x",
                "\ud83c\udded\ud83c\uddf0 HKGO HOME",
                "\ud83c\udded\ud83c\uddf0 HK IPLC 10x",
                "\ud83c\udded\ud83c\uddf0 HK Eons IPLC 2x",
                "\ud83c\udded\ud83c\uddf0 HK1 HKT HY 0.8x",
                "\ud83c\udded\ud83c\uddf0 HK2 DMIT HY 1.5x",
                "\ud83c\udded\ud83c\uddf0 HK3 HYTRON HY 0.1x",
                "\ud83c\udded\ud83c\uddf0 HK4 xTom 1.5x",
                "\ud83c\udde8\ud83c\uddf3 TW1 CM",
                "\ud83c\udde8\ud83c\uddf3 TW1 CU",
                "\ud83c\udde8\ud83c\uddf3 TW2 CM",
                "\ud83c\udde8\ud83c\uddf3 TW2 CU",
                "\ud83c\uddf9\ud83c\uddfc TW Akari IPLC 2x",
                "\ud83c\udde8\ud83c\uddf3 TW HY 0.3x",
                "\ud83c\uddef\ud83c\uddf5 JP1 CM",
                "\ud83c\uddef\ud83c\uddf5 JP1 CU",
                "\ud83c\uddef\ud83c\uddf5 JP2 CM",
                "\ud83c\uddef\ud83c\uddf5 JP2 CU",
                "\ud83c\uddef\ud83c\uddf5 JP3 CM",
                "\ud83c\uddef\ud83c\uddf5 JP3 CU",
                "\ud83c\uddef\ud83c\uddf5 JP4 CM",
                "\ud83c\uddef\ud83c\uddf5 JP4 CU",
                "\ud83c\uddef\ud83c\uddf5 JP SoNet HOME 4x",
                "\ud83c\uddef\ud83c\uddf5 JP IPLC 12x",
                "\ud83c\uddef\ud83c\uddf5 JP Akari IPLC 2x",
                "\ud83c\uddef\ud83c\uddf5 JP1 SAKURA HY 0.1x",
                "\ud83c\uddef\ud83c\uddf5 JP2 VMISS HY 0.8x",
                "\ud83c\uddef\ud83c\uddf5 JP3 Akari HY",
                "\ud83c\uddf8\ud83c\uddec SG1 CU",
                "\ud83c\uddf8\ud83c\uddec SG1 CM",
                "\ud83c\uddf8\ud83c\uddec SG2 CU",
                "\ud83c\uddf8\ud83c\uddec SG2 CM",
                "\ud83c\uddf8\ud83c\uddec SG3 CU",
                "\ud83c\uddf8\ud83c\uddec SG3 CM",
                "\ud83c\uddf8\ud83c\uddec SG4 CU",
                "\ud83c\uddf8\ud83c\uddec SG4 CM",
                "\ud83c\uddf8\ud83c\uddec SG SG.GS IPLC 2x",
                "\ud83c\uddfa\ud83c\uddf8 US1 CU",
                "\ud83c\uddfa\ud83c\uddf8 US1 CM",
                "\ud83c\uddfa\ud83c\uddf8 US2 CU",
                "\ud83c\uddfa\ud83c\uddf8 US2 CM",
                "\ud83c\uddfa\ud83c\uddf8 US3 CU",
                "\ud83c\uddfa\ud83c\uddf8 US3 CM",
                "\ud83c\uddfa\ud83c\uddf8 US4 CU",
                "\ud83c\uddfa\ud83c\uddf8 US4 CM",
                "\ud83c\uddfa\ud83c\uddf8 US Misaka IPLC 2x",
                "\ud83c\uddfa\ud83c\uddf8 US2 ReliableSite HY 0.01x",
                "\ud83c\udde6\ud83c\uddea AE \u6cb9\u6d77\u4e03\u73cd",
                "\ud83c\udde6\ud83c\uddfa AU \u5357\u534a\u7403\u7ebd\u7ea6",
                "\ud83c\udde6\ud83c\uddfa AU \u65b0\u91d1\u5c71",
                "\ud83c\uddee\ud83c\uddf3 IN \u5a46\u7f57\u591a",
                "\ud83c\uddf2\ud83c\uddfe MY \u6a61\u80f6\u548c\u9521\u7684\u738b\u56fd HOME",
                "\ud83c\uddf3\ud83c\uddf5 NP \u574e\u63d0\u666e\u5c14 HOME 3x",
                "\ud83c\uddf0\ud83c\uddf7 KR \u5357\u671d\u9c9c",
                "\ud83c\udde7\ud83c\uddf7 BR \u8db3\u7403\u738b\u56fd",
                "\ud83c\udde8\ud83c\udde6 CA \u67ab\u53f6\u4e4b\u56fd",
                "\ud83c\uddf5\ud83c\uddea PE \u79d8\u9c81\u5171\u548c\u56fd",
                "\ud83c\udde6\ud83c\uddf6 AQ \u9ea5\u514b\u9ed8\u591a\u7ad9",
                "\ud83c\udde6\ud83c\uddf7 AR \u6f58\u5e15\u65af\u96c4\u9e70",
                "\ud83c\udde9\ud83c\uddea DE \u4e16\u754c\u4e4b\u90fd\u65e5\u8033\u66fc\u5c3c\u4e9a",
                "\ud83c\uddee\ud83c\uddf9 IT \u8461\u8404\u9152\u4e4b\u56fd",
                "\ud83c\uddf1\ud83c\uddfa LU \u5343\u5821\u4e4b\u56fd BT\u652f\u63f4 VL 0.01x",
                "\ud83c\uddf1\ud83c\uddfa LU \u8896\u73cd\u738b\u56fd BT\u652f\u63f4",
                "\ud83c\uddf2\ud83c\udde9 MD \u5947\u897f\u7459",
                "\ud83c\uddf3\ud83c\uddec NG \u897f\u975e\u5929\u5e9c\u4e4b\u56fd",
                "\ud83c\uddf3\ud83c\uddec NG \u5c3c\u65e5\u5229\u4e9a\u8054\u90a6\u5171\u548c\u56fd",
                "\ud83c\uddf7\ud83c\uddfa RU \u7b2c\u4e09\u7f57\u9a6c",
                "\ud83c\uddf9\ud83c\uddf7 TR \u5965\u65af\u66fc\u82cf\u4e39\u56fd",
                "\ud83c\uddec\ud83c\udde7 UK \u5927\u4e0d\u5217\u98a0\u53ca\u5317\u7231\u5c14\u5170\u8054\u5408\u738b\u56fd",
                "\ud83d\udcdd \u4ee5\u4e0b\u4e3a\u8282\u70b9\u6807\u7b7e\u4ecb\u7ecd",
                "\ud83d\udcdd UDP \u8bf7\u4f7f\u7528singbox\u6216meta\u5ba2\u6237\u7aef",
                "\ud83d\udcdd CM \u79fb\u52a8\u5165\u53e3",
                "\ud83d\udcdd CU \u8054\u901a\u5165\u53e3",
                "\ud83d\udcdd IPLC \u6caa\u65e5\/\u6df1\u6e2fIPLC",
                "\ud83d\udcdd HOME \u5bb6\u5bbd\u8282\u70b9",
                "\ud83d\udcdd HY HYSTERIA2",
                "\ud83d\udcdd VL VLESS XTLS VISION REALITY"
            ],
            "default": "\ud83d\udcfa EMBY 0.01x"
        }

……
……
        {
            "tag": "\ud83d\udcfa EMBY 0.01x",
            "type": "shadowsocks",
            "server": "jwdiahniwda2341.sfcat.link",
            "server_port": 23832,
            "method": "aes-128-gcm",
            "password": "2dd58ca3-51ee-435e-a0b6-1d14f1e0112b",
            "tcp_multi_path": true,
            "udp_fragment": true
        },
……
……
    ],
    "inbounds": [
        {
            "tag": "tun",
            "type": "tun",
            "inet4_address": "172.19.0.1\/30",
            "inet6_address": "fdfe:dcba:9876::1\/126",
            "mtu": 9000,
            "stack": "system",
            "auto_route": true,
            "strict_route": true,
            "sniff": true,
            "platform": {
                "http_proxy": {
                    "enabled": false,
                    "server": "127.0.0.1",
                    "server_port": 10080
                }
            }
        },
        {
            "tag": "mixed",
            "type": "mixed",
            "listen": "127.0.0.1",
            "listen_port": 10080,
            "sniff": true,
            "domain_strategy": "prefer_ipv4"
        }
    ],

Reproduction

使用singbox安卓客户端,在使用emby节点时,emby客户端无法连接服务器

b77b9e419c709ea617047f0d653405b

Logs

No response

Integrity requirements

bettswang commented 10 months ago
  1. 本地网络是没有ipv6地址的
  2. 将tun上的ipv6接口删除,就可以正常访问
dyhkwong commented 9 months ago

932

bettswang commented 9 months ago

这个我看到了。我的情况比较特殊,我只有这个使用这个节点会出现这种情况,其他节点都是正常。但是如果不用singbox做为客户端,例如使用clashmeta for android,使用这个节点又是正常。

bettswang commented 9 months ago

我猜可能是规则里哪里出错了,但是又实在找不出来,想请大佬有空的话,帮忙看一眼