Ubuntu重启网络服务后DNS被重置

1. 

nano /etc/systemd/resolved.conf

改成如下:

[Resolve]
DNS=8.8.8.8 1.1.1.1 
2. 重启域名解析服务
systemctl restart systemd-resolved
systemctl enable systemd-resolved

3. 备份当前的/etc/resolve.conf,并重新设置/run/systemd/resolve/resolv.conf 到/etc/resolve.conf的软链接
mv /etc/resolv.conf /etc/resolv.conf.bak
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

4. 查看验证,
cat /etc/resolv.conf

5. 例行更新:
apt update -y && sudo apt full-upgrade -y && apt autoremove -y


  1. https://blog.csdn.net/henanchina/article/details/134801287

已发布

分类

来自

标签:

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注