<p>FreeBSD starting with version 10 is shipped with ldns instead of bind as resolver. Consequently the dig tool in base is replaced by drill. While dig can still be installed as a third party application, it would be nice to make do with the tools available in the system already.<br>
This patch rearranges the command line used to invoke dig slightly so that it can be used with both dig and drill (tested with dig 9.8.3-P1 and 9.9.4 as well as drill 1.6.16). It would be really neat if the configure script could be changed to automatically pick up drill when dig is not available (or the other way around), but my autotools-foo is not good enough for that.<br>
This part of the patch is an extended version of the locally maintained patch currently deployed in the FreeBSD ports tree by Dmitry Sivachenko.</p>

<p>Unrelated, to this, the default DNS server, if not specified, now takes into account the -4 and -6 switches (i.e. if -6 is given ::1 is used instead of 127.0.0.1).</p>

<hr>

<h4>You can merge this Pull Request by running</h4>
<pre>  git pull https://github.com/abgandar/nagios-plugins master</pre>
<p>Or view, comment on, or merge it at:</p>
<p>  <a href='https://github.com/nagios-plugins/nagios-plugins/pull/1218'>https://github.com/nagios-plugins/nagios-plugins/pull/1218</a></p>

<h4>Commit Summary</h4>
<ul>
  <li>Update check_dig.c</li>
  <li>Update check_dig.c</li>
</ul>

<h4>File Changes</h4>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/nagios-plugins/nagios-plugins/pull/1218/files#diff-0">plugins/check_dig.c</a>
    (9)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/nagios-plugins/nagios-plugins/pull/1218.patch'>https://github.com/nagios-plugins/nagios-plugins/pull/1218.patch</a></li>
  <li><a href='https://github.com/nagios-plugins/nagios-plugins/pull/1218.diff'>https://github.com/nagios-plugins/nagios-plugins/pull/1218.diff</a></li>
</ul>