我正在尝试确定Nagios主机检查失败的原因(主机名和IP已更改,以保护罪恶感):
: jmglov@laurana; host www.foo.com
;; connection timed out; no servers could be reached
: jmglov@laurana; for ns in `grep -o '\([0-9]\+[.]\)\{3\}[0-9]\+$' /etc/resolv.conf`; do ping -qc 1 $ns; done
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 10.911/10.911/10.911/0.000 ms
PING 192.168.1.2 (192.168.1.2) 56(84) bytes of data.
--- 192.168.1.2 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.241/0.241/0.241/0.000 ms
因此,我知道我的名称服务器是可访问的,这意味着沿着委托路径到主机的权威名称服务器的某些名称服务器没有响应。有没有一种简单的方法来确定这是哪个名称服务器(基本上是DNS 的跟踪路由)?