挖掘超时选项不起作用


9

当我尝试这些命令之一时,它们不会在5秒后停止:

$ dig +time=5 @hii.com hello.me 

-要么-

$ dig @hii.com hello.me +time=5

使用此选项的正确方法是什么?

Answers:


19

超时值是每次尝试的值,因此设置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

或与 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

1
非常感谢你。我打算实际上通过php停止查询,它最初是从这里发出的:stackoverflow.com/questions/9281060/limit-php-execution-time但dig选项更加简单有效。再次感谢。
sg552 2012年
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.