diff --git a/CHANGES b/CHANGES index 8ad381acae..9f688bc8de 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,4 @@ + 779. [func] Added the "minimal-responses" option. 778. [bug] When starting cache cleaning, cleaning_timer_action() returned without first pausing the iterator, which diff --git a/bin/named/config.c b/bin/named/config.c index fe959e1bd2..9429247d74 100644 --- a/bin/named/config.c +++ b/bin/named/config.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: config.c,v 1.4 2001/03/05 13:43:14 tale Exp $ */ +/* $Id: config.c,v 1.5 2001/03/14 21:53:20 halley Exp $ */ #include @@ -94,6 +94,7 @@ options {\n\ # sortlist \n\ # topology \n\ auth-nxdomain false;\n\ + minimal-responses false;\n\ recursion true;\n\ provide-ixfr true;\n\ request-ixfr true;\n\ diff --git a/bin/named/query.c b/bin/named/query.c index 5f769ef85a..86c98453bf 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: query.c,v 1.188 2001/03/14 19:32:58 halley Exp $ */ +/* $Id: query.c,v 1.189 2001/03/14 21:53:21 halley Exp $ */ #include @@ -241,10 +241,6 @@ query_reset(ns_client_t *client, isc_boolean_t everything) { query_maybeputqname(client); client->query.attributes = (NS_QUERYATTR_RECURSIONOK | -#ifdef MINIMIZE_RESPONSES - NS_QUERYATTR_NOAUTHORITY | - NS_QUERYATTR_NOADDITIONAL | -#endif NS_QUERYATTR_CACHEOK); client->query.restarts = 0; client->query.timerset = ISC_FALSE; @@ -1496,10 +1492,8 @@ query_addrdataset(ns_client_t *client, dns_name_t *fname, ISC_LIST_APPEND(fname->list, rdataset, link); -#ifdef MINIMIZE_RESPONSES if (NOADDITIONAL(client)) return; -#endif /* * Add additional data. @@ -2638,7 +2632,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) * database by setting client->query.gluedb. */ client->query.gluedb = db; -#ifdef MINIMIZE_RESPONSES /* * We must ensure NOADDITIONAL is off, * because the generation of @@ -2647,7 +2640,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) */ client->query.attributes &= ~NS_QUERYATTR_NOADDITIONAL; -#endif if (sigrdataset != NULL) sigrdatasetp = &sigrdataset; else @@ -2740,7 +2732,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) client->query.gluedb = zdb; client->query.attributes |= NS_QUERYATTR_CACHEGLUEOK; -#ifdef MINIMIZE_RESPONSES /* * We must ensure NOADDITIONAL is off, * because the generation of @@ -2749,7 +2740,6 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) */ client->query.attributes &= ~NS_QUERYATTR_NOADDITIONAL; -#endif if (sigrdataset != NULL) sigrdatasetp = &sigrdataset; else @@ -3162,10 +3152,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) * Add NS records to the authority section (if we haven't already * added them to the answer section). */ - if (!want_restart -#ifdef MINIMIZE_RESPONSES - && !NOAUTHORITY(client) -#endif + if (!want_restart && !NOAUTHORITY(client) ) { if (is_zone) { if (!((qtype == dns_rdatatype_ns || @@ -3297,6 +3284,10 @@ ns_query_start(ns_client_t *client) { (message->flags & DNS_MESSAGEFLAG_AD) != 0) client->query.attributes |= NS_QUERYATTR_WANTDNSSEC; + if (client->view->minimalresponses) + client->query.attributes |= (NS_QUERYATTR_NOAUTHORITY | + NS_QUERYATTR_NOADDITIONAL); + if ((client->view->cachedb == NULL) || (!client->view->additionalfromcache)) { /* diff --git a/bin/named/server.c b/bin/named/server.c index 9b2ae494a6..396d9ddffb 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: server.c,v 1.303 2001/03/10 06:39:47 tale Exp $ */ +/* $Id: server.c,v 1.304 2001/03/14 21:53:23 halley Exp $ */ #include @@ -729,6 +729,11 @@ configure_view(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig, INSIST(result == ISC_R_SUCCESS); view->auth_nxdomain = cfg_obj_asboolean(obj); + obj = NULL; + result = ns_config_get(maps, "minimal-responses", &obj); + INSIST(result == ISC_R_SUCCESS); + view->minimalresponses = cfg_obj_asboolean(obj); + obj = NULL; result = ns_config_get(maps, "transfer-format", &obj); INSIST(result == ISC_R_SUCCESS); diff --git a/doc/arm/Bv9ARM-book.xml b/doc/arm/Bv9ARM-book.xml index 50f62ab4f4..6a331117c3 100644 --- a/doc/arm/Bv9ARM-book.xml +++ b/doc/arm/Bv9ARM-book.xml @@ -2,7 +2,7 @@ - + BIND 9 Administrator Reference Manual @@ -2576,6 +2576,7 @@ statement in the named.conf file: fetch-glue yes_or_no; has-old-clients yes_or_no; host-statistics yes_or_no; + minimal-responses yes_or_no; multiple-cnames yes_or_no; notify yes_or_no | explicit; recursion yes_or_no; @@ -2847,6 +2848,14 @@ log whenever possible. If you need to disable outgoing incremental zone transfers, use provide-ixfr no. +minimal-responses +If yes, then when generating +responses the server will only add records to the authority and +additional data sections when they are required (e.g. delegations, +negative responses). This may improve the performance of the server. +The default is no. + + multiple-cnames This option was used in BIND 8 to allow a domain name to allow multiple CNAME records in violation of the diff --git a/lib/dns/include/dns/view.h b/lib/dns/include/dns/view.h index 93869f2706..6927429577 100644 --- a/lib/dns/include/dns/view.h +++ b/lib/dns/include/dns/view.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: view.h,v 1.67 2001/02/14 03:50:13 gson Exp $ */ +/* $Id: view.h,v 1.68 2001/03/14 21:53:28 halley Exp $ */ #ifndef DNS_VIEW_H #define DNS_VIEW_H 1 @@ -104,6 +104,7 @@ struct dns_view { isc_boolean_t auth_nxdomain; isc_boolean_t additionalfromcache; isc_boolean_t additionalfromauth; + isc_boolean_t minimalresponses; dns_transfer_format_t transfer_format; dns_acl_t * queryacl; dns_acl_t * recursionacl; diff --git a/lib/dns/view.c b/lib/dns/view.c index 7ec4998bd8..eb5e85a297 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: view.c,v 1.96 2001/02/14 03:50:10 gson Exp $ */ +/* $Id: view.c,v 1.97 2001/03/14 21:53:27 halley Exp $ */ #include @@ -145,6 +145,7 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, view->auth_nxdomain = ISC_FALSE; /* Was true in BIND 8 */ view->additionalfromcache = ISC_TRUE; view->additionalfromauth = ISC_TRUE; + view->minimalresponses = ISC_FALSE; view->transfer_format = dns_one_answer; view->queryacl = NULL; view->recursionacl = NULL; diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index 609f9b096b..464522e031 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: parser.c,v 1.46 2001/03/14 00:30:06 gson Exp $ */ +/* $Id: parser.c,v 1.47 2001/03/14 21:53:29 halley Exp $ */ #include @@ -846,6 +846,7 @@ view_clauses[] = { { "sortlist", &cfg_type_bracketed_aml, 0 }, { "topology", &cfg_type_bracketed_aml, CFG_CLAUSEFLAG_NOTIMP }, { "auth-nxdomain", &cfg_type_boolean, CFG_CLAUSEFLAG_NEWDEFAULT }, + { "minimal-responses", &cfg_type_boolean, 0 }, { "recursion", &cfg_type_boolean, 0 }, { "provide-ixfr", &cfg_type_boolean, 0 }, { "request-ixfr", &cfg_type_boolean, 0 },