diff --git a/CHANGES b/CHANGES index 6af1ba9e9e..47aaa521e3 100644 --- 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] diff --git a/bin/dig/host.c b/bin/dig/host.c index e6c98165d9..ad101bb99e 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -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; } } diff --git a/bin/dig/host.docbook b/bin/dig/host.docbook index a793411abe..f531aeb37a 100644 --- a/bin/dig/host.docbook +++ b/bin/dig/host.docbook @@ -18,7 +18,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - + @@ -53,7 +53,7 @@ host - + @@ -222,6 +222,13 @@ value for an integer quantity. + + The option tells host + not 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. + + The can be used to set the memory usage debugging flags diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 385c4631f7..8205d9f02e 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -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 @@ -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); diff --git a/bin/dig/nslookup.docbook b/bin/dig/nslookup.docbook index b843b4e4ca..ef95adc53d 100644 --- a/bin/dig/nslookup.docbook +++ b/bin/dig/nslookup.docbook @@ -17,7 +17,7 @@ - PERFORMANCE OF THIS SOFTWARE. --> - +