是否可以跟踪DNS查找的委托路径?


16

我正在尝试确定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 的跟踪路由)?

Answers:


33

这对您有用吗?

dig +trace google.com

从手册页:

+ [no] trace 切换从根名称服务器的委派路径到正在查找的名称的跟踪。默认情况下,跟踪是禁用的。启用跟踪后,dig会进行迭代查询以解析要查找的名称。它将遵循来自根服务器的引用,显示来自用于解析该查询的每个服务器的答案。


很有魅力!
乔什·格洛弗

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.