当我尝试这些命令中的任何一个时,它们在 5 秒后不会停止:
$ dig +time=5 @hii.com hello.me
Run Code Online (Sandbox Code Playgroud)
-或者-
$ dig @hii.com hello.me +time=5
Run Code Online (Sandbox Code Playgroud)
使用此选项的正确方法是什么?
use*_*517 23
超时值是每次尝试,因此设置 a+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
Run Code Online (Sandbox Code Playgroud)
或与 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
Run Code Online (Sandbox Code Playgroud)