"host" Return Codes

Chris Thompson cet1 at hermes.cam.ac.uk
Tue Jun 19 18:15:27 UTC 2007


Picking up this from a month ago ...

On May 21 2007, Barry Finkel wrote:
[... major snippage ...]
>>>
>>>Note that Solaris 10 gives a return code of 0, while Ubuntu gives an
>>>expected return code of 1.  I did not see anything in the BIND 9.3.4
>>>CHANGES file about host and return codes.  I do not see any string
>>>within the host executable that tells me the origin of the source.
>
>and Chris Thompson <cet1 at hermes.cam.ac.uk> replied:
>
>>It would appear by comparison with the contemporaneous "dig" that the
>>Solaris 10 /usr/sbin/host is from 9.2.4. And it does indeed have the
>>exit code 0 after NXDOMAIN behaviour that you observe.
>>
[... more snippage ...]
>
>The problem I have is this - I build BIND for my DNS servers, but
>we have one web application where we want to use the "host" command,
>and I would prefer not to build BIND just to get a "dig" that sets the
>return code properly.  The application has to rely on the return code;
>it will not parse any human-readible messages such as
>
>     Host aaa.anl.gov not found: 3(NXDOMAIN)
>
>I am trying to rely on the "dig" supplied by the operating system
>vendor.

There are now Sun patches that bring Solaris 10 /usr/sbin/named and
friends (/usr/sbin/dig & /usr/sbin/host in particular) up to 9.3.4.
They are 119783-03 (sparc) and 119784-03 (x86). They are even marked
"security" and so should be available without a support contract.

That ought to help.

-- 
Chris Thompson
Email: cet1 at cam.ac.uk



More information about the bind-users mailing list