DIG from file???

Stefan Puiu stefan.puiu at gmail.com
Sun Apr 23 20:46:22 UTC 2006


About bloating your log file, you might want to try using host, which
has more sparse output by default (or look into the dig options Kevin
pointed out). Most UNIX programs return a non-zero exit code after
terminating to signal whether an error was encountered when running
(which you can check by examining the $? environment variable in bash,
for example). The dig manual page doesn't mention anything about exit
codes, and at least my Windows dig binary doesn't seem to return
anything but 0 when run from my Cygwin bash. However, as far as I can
tell it works for host:

$ host www.linux.org 193.229.0.40
Using domain server:
Name: 193.229.0.40
[..]
www.linux.org has address 198.182.196.56

fane at stefan ~
$ echo $?
0

$ host www.linux 193.229.0.40
Using domain server:
Name: 193.229.0.40
Address: 193.229.0.40#53
Aliases:

Host www.linux not found: 3(NXDOMAIN)

fane at stefan ~
$ echo $?
1

Thus, you could ignore the output altogether and check only the exit code.

Stefan.

On 20 Apr 2006 12:06:26 -0700, Adisegna at gmail.com <Adisegna at gmail.com> wrote:
> The file out put is fine however, dig is also checking resolv.conf and
> bloating my log file with the ANSWER SECTION and ADDITIONAL SECTION.
> How do I prevent dig from looking in the resolv.conf file for this
> particular query?
>
> Thank in advance..
>
>
>



More information about the bind-users mailing list