Skip to content

windows 使用 sing-box_1.12.0-alpha.12,dns 使用 local 类型,ping 网站时,提示“Ping 请求找不到主机 xxx 。请检查该名称,然后重试” #2635

Open
@bigoovip

Description

操作系统

Windows

系统版本

Windows 11 专业版 23H2

安装类型

sing-box 原始命令行程序

如果您使用图形客户端程序,请提供该程序版本。

No response

版本

sing-box version 1.12.0-alpha.12

Environment: go1.24.0 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_reality_server,with_acme,with_clash_api,with_tailscale
Revision: fe4e9262dede083a78117a42271015596e824b3b
CGO: disabled

描述

windows 使用 sing-box_1.12.0-alpha.9,dns 使用 local 类型时一切正常,ping 网站如 www.baidu.com 时,提示“来自 36.152.44.132 的回复: 字节=32 时间<1ms TTL=128”
windows 使用 sing-box_1.12.0-alpha.12,dns 使用 local 类型时无法正常使用,ping 网站如 www.baidu.com 时,提示“Ping 请求找不到主机 www.baidu.com 。请检查该名称,然后重试。”

以上测试使用同一配置文件,配置文件见下方重现方式。

重现方式

  1. 配置文件
{
	"log": {
		"disabled": false,
		"level": "info",
		"timestamp": true
	},
	"experimental": {
		"clash_api": {
			"external_controller": "0.0.0.0:9090",
			"external_ui": "ui",
			"secret": "",
			"external_ui_download_url": "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip",
			"external_ui_download_detour": "direct",
			"default_mode": "rule",
			"access_control_allow_private_network": true
		},
		"cache_file": {
			"enabled": true,
			"store_fakeip": true,
			"store_rdrc": true
		}
	},
	"dns": {
		"servers": [
			{
				"tag": "local",
				"type": "local"
			}
		],
		"rules": [],
		"final": "local",
		"strategy": "ipv4_only",
		"independent_cache": true
	},
	"inbounds": [
		{
			"tag": "tun-in",
			"type": "tun",
			"address": [
				"172.19.0.1/30"
			],
			"auto_route": true,
			"strict_route": true,
			"route_exclude_address": [
				"192.168.0.0/16"
			],
			"stack": "system"
		}
	],
	"outbounds": [
		{
			"type": "direct",
			"tag": "direct"
		}
	],
	"route": {
		"auto_detect_interface": true,
		"final": "direct",
		"default_domain_resolver": {
			"server": "local",
			"rewrite_tll": 60
		},
		"rules": [
			{
				"action": "sniff"
			},
			{
				"type": "logical",
				"mode": "or",
				"rules": [
					{
						"port": 53
					},
					{
						"protocol": "dns"
					}
				],
				"action": "hijack-dns"
			}
		],
		"rule_set": []
	}
}
  1. 启动命令
sing-box run -c config.json
  1. ping 任意可用网址
ping www.baidu.com
  1. 此时即可观察到提示:
Ping 请求找不到主机 www.baidu.com。请检查该名称,然后重试。

日志

支持我们

完整性要求

  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
  • 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions