+3640. [bug] ndots was not being checked when searching. Only
+ continue searching on NXDOMAIN responses. Add the
+ ability to specify ndots to nslookup. [RT #34711]
+
3639. [bug] Treat type 65533 (KEYDATA) as opaque except when used
in a key zone. [RT #34238]
next_origin(dig_query_t *query) {
dig_lookup_t *lookup;
dig_searchlist_t *search;
+ dns_fixedname_t fixed;
+ dns_name_t *name;
+ isc_result_t result;
INSIST(!free_now);
* about finding the next entry.
*/
return (ISC_FALSE);
+
+ /*
+ * Check for a absolute name or ndots being met.
+ */
+ dns_fixedname_init(&fixed);
+ name = dns_fixedname_name(&fixed);
+ result = dns_name_fromstring2(name, query->lookup->textname, NULL,
+ 0, NULL);
+ if (result == ISC_R_SUCCESS &&
+ (dns_name_isabsolute(name) ||
+ (int)dns_name_countlabels(name) > ndots))
+ return (ISC_FALSE);
+
if (query->lookup->origin == NULL && !query->lookup->need_search)
/*
* Then we just did rootorg; there's nothing left.
}
if (!l->doing_xfr || l->xfr_q == query) {
- if (msg->rcode != dns_rcode_noerror &&
+ if (msg->rcode == dns_rcode_nxdomain &&
(l->origin != NULL || l->need_search)) {
if (!next_origin(query) || showsearch) {
printmessage(query, msg, ISC_TRUE);
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 */
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);
tries = n;
}
+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) {
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);
}