This post was updated 479 days ago and some of the ideas may be out of date.

执行以下命令

cat /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.30.224.1

nameserve后面的地址则是Windows的IP地址