dig return values

Scott Haneda talklists at newgeo.com
Fri May 22 22:15:56 UTC 2009


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.
-- 
Scott * If you contact me off list replace talklists@ with scott@ *




More information about the bind-users mailing list