我應該能夠 ping WSL 中的 DNS

我應該能夠 ping WSL 中的 DNS

在 Windows 10 下的 WSL2 Ubuntu 中,我在呼叫時看到了這一點

貓 /etc/resolv.conf

# This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf:
# [network]
# generateResolvConf = false
nameserver 172.19.80.1

那些失敗了

ping 172.19.80.1
ping 1.1.1.1
ping 8.8.8.8

我可以透過我的 VPN 從 Windows 主機 ping 全域 DNS 伺服器

如果不是的話,linux wsl guest 會出現這種情況嗎?

答案1

看起來這是一個 Hyper-V 問題。

禁用並重新啟動電腦確實解決了該問題。

相關內容