]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1916. [func] host/nslookup now continue (default)/fail on SERVFAIL.
authorMark Andrews <marka@isc.org>
Thu, 25 Aug 2005 00:31:32 +0000 (00:31 +0000)
committerMark Andrews <marka@isc.org>
Thu, 25 Aug 2005 00:31:32 +0000 (00:31 +0000)
                        [RT #15006]

CHANGES
bin/dig/host.c
bin/dig/host.docbook
bin/dig/nslookup.c
bin/dig/nslookup.docbook

diff --git a/CHANGES b/CHANGES
index 6af1ba9e9ef43173b0c6573f3edde57abad2be79..47aaa521e3016a46168cd90a51a2fdf913b571ff 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1916.  [func]          host/nslookup now continue (default)/fail on SERVFAIL.
+                       [RT #15006]
+
 1915.  [func]          dig now has a '-q queryname' and '+showsearch' options.
                        [RT #15034]
 
index e6c98165d986cb3cc0afc76bbf4243b2f28ba4e7..ad101bb99e914df06e008655be5677188f61e460 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: host.c,v 1.104 2005/07/04 03:03:20 marka Exp $ */
+/* $Id: host.c,v 1.105 2005/08/25 00:31:31 marka Exp $ */
 
 /*! \file */
 
@@ -124,6 +124,7 @@ show_usage(void) {
 "       -N changes the number of dots allowed before root lookup is done\n"
 "       -r disables recursive processing\n"
 "       -R specifies number of retries for UDP packets\n"
+"       -s a SERVFAIL response should stop query\n"
 "       -t specifies the query type\n"
 "       -T enables TCP/IP mode\n"
 "       -v enables verbose output\n"
@@ -525,7 +526,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
        return (result);
 }
 
-static const char * optstring = "46ac:dilnm:rt:vwCDN:R:TW:";
+static const char * optstring = "46ac:dilnm:rst:vwCDN:R:TW:";
 
 static void
 pre_parse_args(int argc, char **argv) {
@@ -553,6 +554,7 @@ pre_parse_args(int argc, char **argv) {
                case 'l': break;
                case 'n': break;
                case 'r': break;
+               case 's': break;
                case 't': break;
                case 'v': break;
                case 'w': break;
@@ -586,6 +588,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
 
        lookup = make_empty_lookup();
 
+       lookup->servfail_stops = ISC_FALSE;
+       lookup->comments = ISC_FALSE;
+
        while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
                switch (c) {
                case 'l':
@@ -726,6 +731,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
                        } else
                                fatal("can't find IPv6 networking");
                        break;
+               case 's':
+                       lookup->servfail_stops = ISC_TRUE;
+                       break;
                }
        }
 
index a793411abeaa0e0920f36af1431491527effd550..f531aeb37a4985718ee6f7ae60dc437c177ccdd0 100644 (file)
@@ -18,7 +18,7 @@
  - PERFORMANCE OF THIS SOFTWARE.
 -->
 
-<!-- $Id: host.docbook,v 1.10 2005/07/19 04:55:20 marka Exp $ -->
+<!-- $Id: host.docbook,v 1.11 2005/08/25 00:31:32 marka Exp $ -->
 <refentry id="man.host">
 
   <refentryinfo>
@@ -53,7 +53,7 @@
   <refsynopsisdiv>
     <cmdsynopsis>
       <command>host</command>
-      <arg><option>-aCdlnrTwv</option></arg>
+      <arg><option>-aCdlnrsTwv</option></arg>
       <arg><option>-c <replaceable class="parameter">class</replaceable></option></arg>
       <arg><option>-N <replaceable class="parameter">ndots</replaceable></option></arg>
       <arg><option>-R <replaceable class="parameter">number</replaceable></option></arg>
       value for an integer quantity.
     </para>
 
+    <para>
+      The <option>-s</option> option tells <command>host</command> 
+      <emphasis>not</emphasis> to send the query to the next nameserver
+      if any server responds with a SERVFAIL response, which is the
+      reverse of normal stub resolver behaviour.
+    </para>
+
     <para>
       The <option>-m</option> can be used to set the memory usage debugging
       flags
index 385c4631f7819f64fb7ba87495e24e34094a394a..8205d9f02e94e1a689142aed57f5df76d7165338 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: nslookup.c,v 1.109 2005/07/12 05:47:18 marka Exp $ */
+/* $Id: nslookup.c,v 1.110 2005/08/25 00:31:32 marka Exp $ */
 
 #include <config.h>
 
@@ -50,7 +50,8 @@ static isc_boolean_t short_form = ISC_TRUE,
        comments = ISC_TRUE, section_question = ISC_TRUE,
        section_answer = ISC_TRUE, section_authority = ISC_TRUE,
        section_additional = ISC_TRUE, recurse = ISC_TRUE,
-       aaonly = ISC_FALSE;
+       aaonly = ISC_FALSE, nofail = ISC_TRUE;
+
 static isc_boolean_t in_use = ISC_FALSE;
 static char defclass[MXRD] = "IN";
 static char deftype[MXRD] = "A";
@@ -631,6 +632,10 @@ setoption(char *opt) {
                usesearch = ISC_FALSE;
        } else if (strncasecmp(opt, "sil", 3) == 0) {
                /* deprecation_msg = ISC_FALSE; */
+       } else if (strncasecmp(opt, "fail", 3) == 0) {
+               nofail=ISC_FALSE;
+       } else if (strncasecmp(opt, "nofail", 3) == 0) {
+               nofail=ISC_TRUE;
        } else {
                printf("*** Invalid option: %s\n", opt);        
        }
@@ -689,6 +694,8 @@ addlookup(char *opt) {
        lookup->section_authority = section_authority;
        lookup->section_additional = section_additional;
        lookup->new_search = ISC_TRUE;
+       if (nofail)
+               lookup->servfail_stops = ISC_FALSE;
        ISC_LIST_INIT(lookup->q);
        ISC_LINK_INIT(lookup, link);
        ISC_LIST_APPEND(lookup_list, lookup, link);
index b843b4e4ca703a7ec8d22d8b8945e57158d030ab..ef95adc53da7c48e0bd64a9847cd5ddee015a455 100644 (file)
@@ -17,7 +17,7 @@
  - PERFORMANCE OF THIS SOFTWARE.
 -->
 
-<!-- $Id: nslookup.docbook,v 1.7 2005/05/13 01:35:39 marka Exp $ -->
+<!-- $Id: nslookup.docbook,v 1.8 2005/08/25 00:31:32 marka Exp $ -->
 <!--
  - Copyright (c) 1985, 1989
  -    The Regents of the University of California.  All rights reserved.
@@ -441,6 +441,21 @@ nslookup -query=hinfo  -timeout=10
                 </listitem>
               </varlistentry>
 
+              <varlistentry>
+                <term><constant>
+                    <replaceable><optional>no</optional></replaceable>fail</constant></term>
+                <listitem>
+                  <para>
+                   Try the next nameserver if a nameserver responds with
+                   SERVFAIL or a referral (nofail) or terminate query
+                   (fail) on such a response.
+                 </para>
+                 <para>
+                    (Default = nofail)
+                  </para>
+               </listitem>
+             </varlistentry>
+
             </variablelist>
           </para>
         </listitem>