diff options
Diffstat (limited to 'bin/dig/nslookup.c')
-rw-r--r-- | bin/dig/nslookup.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index 2ef8f84ea2a7..cf64e5899850 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 @@ -434,8 +434,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 */ @@ -494,8 +493,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); @@ -567,6 +566,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); @@ -646,6 +653,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); } |