关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

Ubuntu20系统里面PING不通域名,如何设置dns并生效

发布时间:2024/5/14 14:04:37
香港云服务器

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 域名,就会发现正常了。