赞
踩
在Ubuntu20.04的文件/etc/resolv.conf只能查看,不能修改
方法一:修改/etc/systemd/resolved.conf 文件
vim /etc/systemd/resolved.conf
systemctl restart systemd-resolved
systemctl enable systemd-resolved
mv /etc/resolv.conf /etc/resolv.conf.bak
ln -s /run/systemd/resolve/resolv.conf /etc/cat /etc/resolv.conf #查看dns文件
方法二:修改/etc/netplan/00-installer-config.yaml文件
vim /etc/netplan/00-installer-config.yaml
netplan apply #生效
cat /etc/resolv.conf #查看dns文件
在Centos7.6的文件/etc/resolv.con可以修改
vim /etc/resolv.conf
systemctl restart NetworkManager #生效cat /etc/resolv.conf #查看dns文件
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。