为什么主机命令返回 SERVFAIL

为什么主机命令返回 SERVFAIL

我尝试对我的博客 jfeatures.com 使用主机命令并收到错误(SERVFAIL)。我的博客使用 google 域,它由 github 页面提供支持。

$ host jfeatures.com
jfeatures.com has address 185.199.111.153
jfeatures.com has address 185.199.108.153
jfeatures.com has address 185.199.109.153
jfeatures.com has address 185.199.110.153

找不到主机 jfeatures.com:2(SERVFAIL)

jfeatures.com mail is handled by 20 alt2.gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 40 alt4.gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 5 gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 10 alt1.gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 30 alt3.gmr-smtp-in.l.google.com.
alt2.gmr-smtp-in.l.google.com has address 142.250.141.14
alt4.gmr-smtp-in.l.google.com has address 64.233.171.14
gmr-smtp-in.l.google.com has address 142.251.10.14
alt1.gmr-smtp-in.l.google.com has address 173.194.202.14
alt3.gmr-smtp-in.l.google.com has address 142.250.115.14

如果我指定 DNS 服务器,它似乎会按预期工作。以下是结果host jfeatures.com 8.8.8.8

host jfeatures.com 8.8.8.8
Using domain server:
Name: 8.8.8.8
Address: 8.8.8.8#53
Aliases:

jfeatures.com has address 185.199.109.153
jfeatures.com has address 185.199.111.153
jfeatures.com has address 185.199.110.153
jfeatures.com has address 185.199.108.153
jfeatures.com mail is handled by 10 alt1.gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 30 alt3.gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 40 alt4.gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 5 gmr-smtp-in.l.google.com.
jfeatures.com mail is handled by 20 alt2.gmr-smtp-in.l.google.com.

答案1

使用命令上的额外参数,您将绕过通过并专门使用您提供的host默认 DNS 服务器定义的服务器:/etc/resolv.conf

host jfeatures.com 8.8.8.8    # {domain} {dns_server}

鉴于您在指定上游 DNS 服务器(1.1.1.18.8.8.8、 或9.9.9.9已确认的工作替代方案)时无法重现该问题,我建议您的上游 DNS 服务器出现问题。

在家里,它可以是您的本地主机或您的 ISP 自己的服务器。在工作中,它通常是您网络的 DNS 服务器。根据您想要参与识别故障组件的程度,您可以通过 DNS 服务器链进行工作。例如,如果包含对您正在使用的/etc/resolv.conf引用,则您需要检查上游 DNS 服务器的详细信息。否则使用值本身。nameserver 127.0.0.53systemd-resolved/run/systemd/resolve/resolv.conf/etc/resolv.conf

相关内容