小编Mor*_*ten的帖子

WSL - 连接到 VPN 时 DNS 不工作

我已经使用 WSL Bash/Ubuntu 好几年了,但由于某种原因,这个问题最近出现了。
DNS 无法解析任何名称,包括内部名称和外部名称。我第一次重新安装 WSL 时,我认为它可以工作一天……但现在不行了,即使我重新安装。

从 Windows Store 全新安装 Ubuntu 18.04:

user@hostname:~$ cat /etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line.
nameserver <DNS server from wi-fi NIC 1>
nameserver <DNS server from wi-fi NIC 2>
nameserver <DNS server from ethernet 2 (VPN) NIC 1>
search anyconnect.local

user@hostname:~$ ping google.com -c 1
ping: google.com: Name or service not known

user@hostname:~$ ping 8.8.8.8 -c 1
PING 8.8.8.8 (8.8.8.8) …
Run Code Online (Sandbox Code Playgroud)

linux dns vpn windows-subsystem-for-linux

15
推荐指数
4
解决办法
2万
查看次数

标签 统计

dns ×1

linux ×1

vpn ×1

windows-subsystem-for-linux ×1