- vi /etc/systemd/resolved.conf,
[Resolve] DNS=8.8.8.8 114.114.114.114 192.168.4.2
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
apt update -y && sudo apt full-upgrade -y && apt autoremove -y