在 linux 系统中,可以使用 resolvconf 工具来管理 /etc/resolv.conf 文件。这个工具会在系统重启后自动重新配置 DNS。 另外一种方法是直接修改/etc/network/interfaces 文件,在里面
在 linux 系统中,可以使用 resolvconf
工具来管理 /etc/resolv.conf
文件。这个工具会在系统重启后自动重新配置 DNS。
另外一种方法是直接修改/etc/network/interfaces
文件,在里面加上 dns-nameservers x.x.x.x 便可
你可以通过运行 sudo resolvconf -u
来更新 DNS 配置,使之生效。
此外,也可以在/etc/network/interfaces
中配置,如下
# The primary network interfaceauto enp0s3iface enp0s3 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 8.8.8.8 8.8.4.4
如果你是通过修改 /etc/resolv.conf 文件来修改 DNS 配置的,请确保这个文件的权限设置正确。
来源地址:https://blog.csdn.net/weixin_35754676/article/details/129085417
--结束END--
本文标题: linux /etc/resolv.conf 改完dns 怎么保证重启仍然生效
本文链接: https://www.lsjlt.com/news/424103.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0