clash_for_windows_pkg icon indicating copy to clipboard operation
clash_for_windows_pkg copied to clipboard

[Bug]: TUN模式DNS问题

Open xushulang opened this issue 2 years ago • 9 comments

请认真检查以下清单中的每一项

  • [X] 已经搜索过,没有发现类似issue
  • [x] 已经搜索过文档,没有发现相关内容
  • [x] 已经尝试使用过最新版,问题依旧存在
  • [x] 使用的是官方版本(未替换及修改过安装目录程序文件)

软件版本

0.19.29

操作系统

Windows x64

系统版本

Windows 11 pro

问题描述

image 开启TUN模式,两个域名,一个走cfw,一个解析为了ipv6,没走cfw

复现步骤

同时开启IPV4和IPV6,cfw开启TUN模式,终端ping图中两个域名

日志文件

logs

进入Home Directory/logs文件夹,找到日志文件,将文件拖动至输入框或点击界面左下角小字,将打开文件内容粘贴替换这行

其他补充

No response

xushulang avatar Aug 28 '22 12:08 xushulang

感觉是 Windows DNS client cache 中有东西。

或者是 Clash DNS server 的 fake-ip-filter 放过了这个域名。


而且,我注意到 soketi.app 的 TTL 很长,Cloudflare 返回的足有 5 分钟。

Name       Type TTL Section IPAddress
----       ---- --- ------- ---------
soketi.app AAAA 300 Answer  2606:4700:3030::ac43:a560
soketi.app AAAA 300 Answer  2606:4700:3035::6815:5b22
soketi.app A    300 Answer  104.21.91.34
soketi.app A    300 Answer  172.67.165.96

请检查 DNS cache:

Clear-DnsClientCache
Resolve-DnsName -Name 'soketi.app'
Get-DnsClientCache -Entry 'soketi.app' | Format-Table -AutoSize

以及 NRPT:

Get-DnsClientNrptPolicy -Effective | Select-Object -ExpandProperty Namespace

Lemmingh avatar Aug 28 '22 13:08 Lemmingh

tun 不支持 ipv6 吧

QS0x01 avatar Aug 28 '22 15:08 QS0x01

对,TUN 目前不支持 IPv6,只有 IPv4。


按我的理解,此处的疑点是,这台机器上的 AAAA 记录从哪里来。

Fake IP 应当比正常的 DNS 快。除非有特别的配置(比如,NRPT、fake-ip-filter),所有响应都应该是 Clash Fake IP。

Lemmingh avatar Aug 28 '22 15:08 Lemmingh

感觉是 Windows DNS client cache 中有东西。

或者是 Clash DNS server 的 fake-ip-filter 放过了这个域名。

而且,我注意到 soketi.app 的 TTL 很长,Cloudflare 返回的足有 5 分钟。

Name       Type TTL Section IPAddress
----       ---- --- ------- ---------
soketi.app AAAA 300 Answer  2606:4700:3030::ac43:a560
soketi.app AAAA 300 Answer  2606:4700:3035::6815:5b22
soketi.app A    300 Answer  104.21.91.34
soketi.app A    300 Answer  172.67.165.96

请检查 DNS cache:

Clear-DnsClientCache
Resolve-DnsName -Name 'soketi.app'
Get-DnsClientCache -Entry 'soketi.app' | Format-Table -AutoSize

以及 NRPT:

Get-DnsClientNrptPolicy -Effective | Select-Object -ExpandProperty Namespace

DNS里显示指向的是IPV6地址,纯IPV4网络环境正常,IPV4和IPV6同时存在的网络环境,这条域名访问就没走cfw,检查了fake-ip-filter未包含该域名,甚至连docs.cfw.lbyczf.com也没走cfw

xushulang avatar Aug 29 '22 01:08 xushulang

感觉是 Windows DNS client cache 中有东西。

或者是 Clash DNS server 的 fake-ip-filter 放过了这个域名。

而且,我注意到 soketi.app 的 TTL 很长,Cloudflare 返回的足有 5 分钟。

Name       Type TTL Section IPAddress
----       ---- --- ------- ---------
soketi.app AAAA 300 Answer  2606:4700:3030::ac43:a560
soketi.app AAAA 300 Answer  2606:4700:3035::6815:5b22
soketi.app A    300 Answer  104.21.91.34
soketi.app A    300 Answer  172.67.165.96

请检查 DNS cache:

Clear-DnsClientCache
Resolve-DnsName -Name 'soketi.app'
Get-DnsClientCache -Entry 'soketi.app' | Format-Table -AutoSize

以及 NRPT:

Get-DnsClientNrptPolicy -Effective | Select-Object -ExpandProperty Namespace

DNS里显示指向的是IPV6地址,纯IPV4网络环境正常,IPV4和IPV6同时存在的网络环境,这条域名访问就没走cfw,检查了fake-ip-filter未包含该域名,甚至连docs.cfw.lbyczf.com也没走cfw

没有优先走ipv4? 试试这个 https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows#use-registry-key-to-configure-ipv6

AkariiinMKII avatar Aug 29 '22 10:08 AkariiinMKII

我的CFW好像没有这个问题 image

CoolPlayLin avatar Sep 03 '22 04:09 CoolPlayLin

放个配置文件?

CoolPlayLin avatar Sep 03 '22 04:09 CoolPlayLin

本人使用TUN模式,关闭代理模式,浏览器上不了外网,但访问百度等国内网站和谷歌邮箱正常。 点进“连接”里一看全是IP,而没有域名,意识到就是DNS的问题。 解决途径: image image 然后关闭“系统代理”开关,打开“TUN模式”开关,域名解析恢复正常,问题完全解决。看来114的DNS是内鬼,故意使跘子。

singularity2000 avatar Sep 04 '22 06:09 singularity2000

我的CFW好像没有这个问题 image

你本地网络是否同时支持ipv4和ipv6?我另一台电脑正常,也是奇怪

xushulang avatar Sep 05 '22 06:09 xushulang

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

Fndroid avatar Nov 05 '22 00:11 Fndroid