DNS/名称服务器问题。无法 ping IP 或域

DNS/名称服务器问题。无法 ping IP 或域

当我 ping 一个 IP 时,我得到以下信息:

21:31:50.136623 IP SITE_IP > 173.194.33.4: ICMP echo request, id 14941, seq 1, length 64
21:31:51.136138 IP SITE_IP > 173.194.33.4: ICMP echo request, id 14941, seq 2, length 64
21:31:52.136118 IP SITE_IP > 173.194.33.4: ICMP echo request, id 14941, seq 3, length 64
21:31:53.136129 IP SITE_IP > 173.194.33.4: ICMP echo request, id 14941, seq 4, length 64
21:31:54.136102 IP SITE_IP > 173.194.33.4: ICMP echo request, id 14941, seq 5, length 64
21:31:55.136153 IP SITE_IP > 173.194.33.4: ICMP echo request, id 14941, seq 6, length 64

当我 ping 一个域时:

21:29:33.631583 IP 74.125.189.19.52085 > SITE_IP.domain: 28952 A? google.com.MY_DOMAIN. (42)
21:29:38.626553 IP SITE_IP.42280 > 8.8.4.4.domain: 52435+ A? google.com.MY_DOMAIN. (42)
21:29:38.652675 IP 74.125.189.22.63658 > SITE_IP.domain: 36178 A? google.com.MY_DOMAIN. (42)
21:29:43.631626 IP SITE_IP.48205 > 8.8.8.8.domain: 52435+ A? google.com.MY_DOMAIN. (42)

域名 ping 令我担心,因为它看起来正在检查我的 DNS 文件以进行解析。

这是 etc/resolv.conf

nameserver 8.8.8.8
nameserver 8.8.4.4

/etc/hosts

127.0.0.1               localhost localhost.localdomain localhost4 localhost4.localdomain4
::1             localhost localhost.localdomain localhost6 localhost6.localdomain6
SITE_iP            server.MY_DOMAIN.com server

还要补充一点,我看到了许多“SERVFAIL”......

我不知道是什么导致了这个问题。如果我需要提供任何其他信息,请告诉我。我正在使用 CentOS。

路线-n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
46.249.48.0     0.0.0.0         255.255.255.0   U     0      0        0 em1
0.0.0.0         46.249.48.1     0.0.0.0         UG    0      0        0 em1

是否配置

em1       Link encap:Ethernet  HWaddr D0:*
      inet addr:server_ip  Bcast:46.249.48.255  Mask:255.255.255.0
      inet6 addr: inet6_addr Scope:Global
      inet6 addr: inet6_addr Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:516053 errors:0 dropped:0 overruns:0 frame:0
      TX packets:557877 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:110304822 (105.1 MiB)  TX bytes:520208744 (496.1 MiB)
      Interrupt:16 Memory:c0000000-c0012800

答案1

当您 ping 一个名称时,ping需要先将主机名或域名解析为 IP 地址,因此需要进行名称查找。检查/etc/host.conf系统首先查找的位置。order:hosts,bind会先检查/etc/hostsorder:bind,hosts会先检查 DNS。此外,您尝试 ping 的域名是否完全解析?

相关内容