如何才能使“/etc/resolv.conf”的更改保留在 Windows 的 Linux 子系统上?

如何才能使“/etc/resolv.conf”的更改保留在 Windows 的 Linux 子系统上?

我没有网络连接这个问题。在尝试排除故障时,第一个建议是编辑/etc/resolv.conf。当您最初打开文件时,它看起来像这样:

# This file was automatically generated by WSL. To stop automatic generation of this file, remove this line.
nameserver 10.10.0.223
nameserver fec0:0:0:ffff::1
nameserver fec0:0:0:ffff::2
search example.net

编辑文件后(从不确定首选项文件何时真正生效),我退出bash并重新登录。当我重新登录时,文件恢复到其原始出厂内容。我尝试过的方法:

  • 以 身份运行 Powershell(从中bash启动)Administrator
  • 逃离。bashcmd
  • 删除第一行,留下一行空白。
  • 删除第一行和空白行。

相关内容