ubuntu - 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
它在短期内解决了这个问题,我将运行一个需要联系我的域控制面板的守护进程。所以我需要一个长期的解决方案。如果有人对此问题有解决方案,那可能会很棒。
解决方案
我遇到了完全相同的问题,但我用另一种方法解决了它。
使用 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
我已经成功地对此进行了测试。
推荐阅读
- regex - 使用正则表达式替换字符串中的特殊字符
- python - Python平均嵌套字典列表列表
- opentext - 如何修复 Captiva 识别中的“不支持颜色深度(每像素 32 位)”错误?
- android - Android 应用程序 - 按用户排序的调试日志数据可实时用于客户服务目的
- arrays - “错误:LoadError:BoundsError:尝试访问索引 [1] 处的 0 元素数组 {Candidate,1}”尝试填充复合类型的空数组时
- java - 如何生成随机字节,然后在 Swift 中将它们转换为字符串
- r - 使用 R 中的矢量化代码比较和替换多列之间的值
- python - 进程以 Python 中的退出代码 -1073741571 (0xC00000FD) 完成
- javascript - 我可以使用 Google Apps 脚本将 Google 表格中的条件格式注入 Google 幻灯片吗?
- python - 修改数据集的某些元素时发出警告