dig return values

David Forrest drf at maplepark.com
Fri May 22 22:52:16 UTC 2009


On Fri, 22 May 2009, Scott Haneda 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.

Dave

-- 
David Forrest
St. Louis, Missouri



More information about the bind-users mailing list