return code from host command

Smith, Earl (Exchange) emsmith at Bear.com
Wed Aug 31 13:38:18 UTC 2005


-- Attached file included as plaintext by Ecartis --

It does appear that the host command that comes with bind 9.3.1 does
give me the proper return code, while the host command that comes with
bind 9.2.1 always gives me a return code of zero.  Thanks very much for
your help.

 

Earl M. Smith

emsmith at bear.com

beeper  917-401-0087

cell       201-390-6893

desk     212-272-1502 (not often there)

  _____  

From: Stefan Puiu [mailto:stefan.puiu at gmail.com] 
Sent: Wednesday, August 31, 2005 1:59 AM
To: Kurt Boyack
Cc: Smith, Earl (Exchange); bind-users at isc.org
Subject: Re: return code from host command

 

Well, first of all, some times it helps to mention the version of BIND
you're using (the remark is for the OP). Or, more specifically, the
version of BIND from which the two 'host' commands are coming. 

By looking at the code for 9.3.1 host (bin/dig/host.c) I see in the last
line: 

       return ((seen_error == 0) ? 0 : 1);

So, I guess a return code of 1 means some error happened, though I
didn't check when 'seen_error' is set. Use either host -v or dig to see
more of the details, by default host doesn't have an output you might
call "verbose" :). 

On 8/30/05, Kurt Boyack <kboyack at gmail.com> wrote:

On 8/30/05, Smith, Earl (Exchange) <emsmith at bear.com> wrote:
>=20
> When I do a host command on a remote machine (not the DNS server),
host
> gives me a return code of 0 even when the machine is not found.  When
I 
> do the identical command on the DNS server I get the same answer, but
> the return code is 1, which is what I would have expected.  Why?
>=20

I have never seen anything other than a return code of 0 from host 
when it is able to give an answer; even if the answer is "not found".
It would make life easier if the host command would return a non zero
exit code when no record is found.



 



-- Attached file included as plaintext by Ecartis --
-- File: Disclaimer



**********************************************************************
Please be aware that, notwithstanding the fact that the person sending
this communication has an address in Bear Stearns' e-mail system, this
person is not an employee, agent or representative of Bear Stearns.
Accordingly, this person has no power or authority to represent, make
any recommendation, solicitation, offer or statements or disclose
information on behalf of or in any way bind Bear Stearns or any of its
affiliates.
**********************************************************************





More information about the bind-users mailing list