首页 > 解决方案 > ping: google.com: 名称解析暂时失败

问题描述

ping: google.com: Temporary failure in name resolution

这个问题是尝试 ping 域而不是 IP 时发生的问题,此时在 resolve.conf 中它具有 127.0.0.57 IP,尝试添加此

nameserver 8.8.8.8

它在短期内解决了这个问题,我将运行一个需要联系我的域控制面板的守护进程。所以我需要一个长期的解决方案。如果有人对此问题有解决方案,那可能会很棒。

标签: ubuntudnsubuntu-18.04

解决方案


我遇到了完全相同的问题,但我用另一种方法解决了它。

使用 Ubuntu 18.04,首先禁用systemd-resolved服务。

sudo systemctl disable systemd-resolved.service

停止服务

sudo systemctl stop systemd-resolved.service

然后,删除链接/run/systemd/resolve/stub-resolv.conf/etc/resolv.conf

sudo rm /etc/resolv.conf

添加一个手动创建resolv.conf/etc/

sudo vim /etc/resolv.conf

在那里添加您喜欢的 DNS 服务器

nameserver 208.67.222.222

我已经成功地对此进行了测试。


推荐阅读