Ubuntu 20.04 LTS 版本
登录系统
sudo -i //获取root权限
首先修改
vim /etc/systemd/resolved.conf
//很容易找到DNS位置,默认已被注释,去掉#号,添加自己的dns地址
DNS=114.114.114.114 119.29.29.29 8.8.8.8
:wq //保存并退出
然后以root身份在ubuntu终端中依次执行如下命令:
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信息..
© 版权声明
THE END
暂无评论内容