linux - 重现 `Temporary failure in name resolution`

标签 linux dns dnsmasq networkmanager

在 Linux 中执行 ping google.com 时,如何手动重现 Temporary failure in name resolution 错误?

也许,我可以自己添加一个损坏的DNS服务器并在/etc/resolv.conf中指定它?

我需要这个来测试我的项目。

最佳答案

您可以在 /etc/nsswitch.conf 中尝试:

hosts:          files

那是为 hosts 案例删除所有 dns 服务的痕迹(正常行更像是 hosts: files dns 但是在更改之前先看看你的)。

然后,如果名称/IP 在 /etc/hosts 中,则名称解析有效,如果不在,则它不起作用,因为未咨询 DNS。

关于linux - 重现 `Temporary failure in name resolution`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52896671/

相关文章:

mysql - 恢复数据库备份导致坏字符

Linux-运行可执行文件时出错

linux - 在 Linux 上 : how can I programmatically determine if a NIC interface is enabled and plugged in?

php - cURL + Laravel Valet + dnsmasq 不工作

macos - 使用 Homebrew 安装 dnsmasq

php - 如何为 php 启用 mysqlnd?

amazon-web-services - 为 EC2 实例保持相同的公共(public) DNS

dns - 为什么这个 DNS 的 QNAME 没有 q。以 NULL 字符结尾?

audio - Skype 业务 2015 : Audio/Video not working in meetings