diff --git a/CHANGES b/CHANGES index 283164758b..917644face 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,11 @@ + + 701. [func] Root hints are now fully optional. Class IN + views use compiled-in hints by default, as + before. Non-IN views with no root hints now + provide authoritative service but not recursion. + A warning is logged if a view has neither root + hints nor authoritative data for the root. [RT #696] + 700. [bug] $GENERATE range check was wrong. [RT #688] 699. [bug] The lexer mishandled empty quoted strings. [RT #694] diff --git a/bin/named/query.c b/bin/named/query.c index cd95fec5ba..43aee30e00 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.174 2001/01/11 20:48:27 gson Exp $ */ +/* $Id: query.c,v 1.175 2001/01/22 19:21:19 gson Exp $ */ #include @@ -2567,13 +2567,19 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) * the hints DB. */ INSIST(!is_zone); - INSIST(client->view->hints != NULL); if (db != NULL) dns_db_detach(&db); - dns_db_attach(client->view->hints, &db); - result = dns_db_find(db, dns_rootname, NULL, dns_rdatatype_ns, - 0, client->now, &node, fname, - rdataset, sigrdataset); + + if (client->view->hints == NULL) { + /* We have no hints. */ + result = ISC_R_FAILURE; + } else { + dns_db_attach(client->view->hints, &db); + result = dns_db_find(db, dns_rootname, + NULL, dns_rdatatype_ns, + 0, client->now, &node, fname, + rdataset, sigrdataset); + } if (result != ISC_R_SUCCESS) { /* * We can't even find the hints for the root diff --git a/bin/named/server.c b/bin/named/server.c index 211856b78e..404c026a83 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.282 2001/01/18 00:14:20 bwelling Exp $ */ +/* $Id: server.c,v 1.283 2001/01/22 19:21:18 gson Exp $ */ #include @@ -562,15 +562,23 @@ configure_view(dns_view_t *view, dns_c_ctx_t *cctx, dns_c_view_t *cview, /* * If we still have no hints, this is a non-IN view with no - * "hints zone" configured. That's an error. + * "hints zone" configured. Issue a warning, except if this + * is a root server. Root servers never need to consult + * their hints, so it's no point requireing users to configure + * them. */ if (view->hints == NULL) { - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, - NS_LOGMODULE_SERVER, ISC_LOG_ERROR, - "no root hints for view '%s'", - cview == NULL ? "" : cview->name); - result = ISC_R_FAILURE; - goto cleanup; + dns_zone_t *rootzone = NULL; + dns_view_findzone(view, dns_rootname, &rootzone); + if (rootzone != NULL) { + dns_zone_detach(&rootzone); + } else { + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_WARNING, + "no root hints for view '%s'", + cview == NULL ? "" : + cview->name); + } } /*