dig return values
Scott Haneda
talklists at newgeo.com
Fri May 22 23:40:38 UTC 2009
On May 22, 2009, at 3:52 PM, David Forrest wrote:
>> I have searched for "dig return codes" and also looked at the man
>> page, leading me to nothing definitive.
>>
>> Does `dig` have return codes that I can use to make some form of
>> automated tests?
>>
>> foo=`dig NS example.com @ns2.example.com +short +time=2 +tries=1`
>> echo $foo
>>
>> ; <<>> DiG 9.4.3-P1 <<>> NS example.com @ns2.example.com +short
>> +time=2
>> +tries=1 ;;
>> global options: printcmd ;;
>> connection timed out; no servers could be reached
>>
>> I do not know, nor would I want to have to know, all the possible
>> return strings I may get back. My needs are simple, I believe any
>> ANSWER of > 0 I would determine to be true, any timeout of any form
>> I would determine to be false.
>>
>> Can anyone point me to docs on return codes, or is this going to
>> amount to string parsing? If it does, how much deviation on return
>> messages are there from the various dig versions that have been
>> released?
>>
>> Thank you.
>>
>
> my dig (version DiG 9.6.1b1) returns RC 0 on both an answer and a
> connection timeout, and would seem to require a string parsing for a
> useful branch. F9 64 system.
Would you mind sharing with me how you tested that return value? I am
not seeing that bahavior at all, I get a true return for anything. I
have not been able to get false as of yet.
Thanks David.
--
Scott * If you contact me off list replace talklists@ with scott@ *
More information about the bind-users
mailing list