vi /etc/systemd/resolved.conf
将resolved.conf内容中的 #dns= 改为 dns8.8.8.8
保存后 ,继续执行以下命令,逐行复制并执行
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文件再次PING 域名,就会发现正常了。