diff options
Diffstat (limited to 'bin/dig/nslookup.c')
| -rw-r--r-- | bin/dig/nslookup.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 3f5b82fd292df..6c2f0a949983e 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -442,8 +442,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { dns_name_format(query->lookup->name, nametext, sizeof(nametext)); printf("** server can't find %s: %s\n", - (msg->rcode != dns_rcode_nxdomain) ? nametext : - query->lookup->textname, rcode_totext(msg->rcode)); + nametext, rcode_totext(msg->rcode)); debug("returning with rcode == 0"); /* the lookup failed */ @@ -502,8 +501,8 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) { printf(" %s\t\t%s\n", usesearch ? "search" : "nosearch", recurse ? "recurse" : "norecurse"); - printf(" timeout = %d\t\tretry = %d\tport = %d\n", - timeout, tries, port); + printf(" timeout = %d\t\tretry = %d\tport = %d\tndots = %d\n", + timeout, tries, port, ndots); printf(" querytype = %-8s\tclass = %s\n", deftype, defclass); printf(" srchlist = "); for (listent = ISC_LIST_HEAD(search_list); @@ -575,6 +574,14 @@ set_tries(const char *value) { } static void +set_ndots(const char *value) { + isc_uint32_t n; + isc_result_t result = parse_uint(&n, value, 128, "ndots"); + if (result == ISC_R_SUCCESS) + ndots = n; +} + +static void setoption(char *opt) { if (strncasecmp(opt, "all", 4) == 0) { show_settings(ISC_TRUE, ISC_FALSE); @@ -654,6 +661,8 @@ setoption(char *opt) { nofail=ISC_FALSE; } else if (strncasecmp(opt, "nofail", 3) == 0) { nofail=ISC_TRUE; + } else if (strncasecmp(opt, "ndots=", 6) == 0) { + set_ndots(&opt[6]); } else { printf("*** Invalid option: %s\n", opt); } @@ -767,7 +776,8 @@ get_next_command(void) { if (interactive) { #ifdef HAVE_READLINE ptr = readline("> "); - add_history(ptr); + if (ptr != NULL) + add_history(ptr); #else fputs("> ", stderr); fflush(stderr); |
