当我尝试使用这些命令时,它们在5秒后不会停止:
$ dig +time=5 @hii.com hello.me
-要么-
$ dig @hii.com hello.me +time=5
什么是使用这个选项的正确方法?
超时值是每次尝试,所以设置+time=5将导致15秒的延迟,因为+tries的默认值是3 。 如果你设置+tries=1那么你的命令将在5秒内超时,例如
time dig +time=5 @hii.com hello.me ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5_7.1 <<>> +time=5 @hii.com hello.me ; (1 server found) ;; global options: printcmd ;; connection timed out; no servers could be reached real 0m15.017s user 0m0.003s sys 0m0.011s
或与一个tries=1
time dig +time=5 +tries=1 @hii.com hello.me ; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5_7.1 <<>> +time=5 +tries=1 @hii.com hello.me ; (1 server found) ;; global options: printcmd ;; connection timed out; no servers could be reached real 0m5.015s user 0m0.006s sys 0m0.007s