DIG from file???

Kevin Darcy kcd at daimlerchrysler.com
Fri Apr 21 22:04:54 UTC 2006

Adisegna at gmail.com wrote:

>I have a cron job that tests multiple server query times for a single
>*/5 * * * * /usr/bin/dig -f /home/username/scripts/dig >>
>One of the dig file entries looks like this:
>host.domain.com @ +noauthority +noadditional +tries=1 +time=1
>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?
You can control the output of the Answer Section with +ans/+noans. Your 
+noadditional should already be suppressing output of the Additional 
Section. Isn't it? If +noadditional is not working in your version of 
dig, maybe you need to upgrade to a later version that understands the 

If it's just the *comment* lines containing "ANSWER SECTION" and/or 
"ADDITIONAL SECTION" that you want to suppress, you can use +nocomments.

As for looking at /etc/resolv.conf, I think this is pretty much 
hardcoded into dig, either directly (because older versions call the the 
generic res_init()/res_ninit() function from the resolver library), or 
indirectly (newer versions use the lwres_*() routines, which initialize 
by default from /etc/resolv.conf). But, why do you care whether dig 
looks at /etc/resolv.conf or not? It doesn't make any difference to the 
output and shouldn't really be a performance issue either.

                                       - Kevin

More information about the bind-users mailing list