summaryrefslogtreecommitdiff
path: root/usr.sbin/bind/bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bind/bin')
-rw-r--r--usr.sbin/bind/bin/named/server.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/usr.sbin/bind/bin/named/server.c b/usr.sbin/bind/bin/named/server.c
index cdfd6760c8b..46fd65c1a3b 100644
--- a/usr.sbin/bind/bin/named/server.c
+++ b/usr.sbin/bind/bin/named/server.c
@@ -1248,7 +1248,9 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
cfg_obj_t *typeobj = NULL;
cfg_obj_t *forwarders = NULL;
cfg_obj_t *forwardtype = NULL;
+ cfg_obj_t *only = NULL;
isc_result_t result;
+ isc_result_t tresult;
isc_buffer_t buffer;
dns_fixedname_t fixorigin;
dns_name_t *origin;
@@ -1314,14 +1316,25 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
}
if (dns_name_equal(origin, dns_rootname)) {
char *hintsfile = cfg_obj_asstring(fileobj);
+
result = configure_hints(view, hintsfile);
- if (result != ISC_R_SUCCESS)
+ if (result != ISC_R_SUCCESS) {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER,
ISC_LOG_ERROR,
"could not configure root hints "
"from '%s': %s", hintsfile,
isc_result_totext(result));
+ goto cleanup;
+ }
+ /*
+ * Hint zones may also refer to delegation only points.
+ */
+ only = NULL;
+ tresult = cfg_map_get(zoptions, "delegation-only",
+ &only);
+ if (tresult == ISC_R_SUCCESS && cfg_obj_asboolean(only))
+ CHECK(dns_view_adddelegationonly(view, origin));
} else {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER, ISC_LOG_WARNING,
@@ -1349,6 +1362,14 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
}
/*
+ * "delegation-only zones" aren't zones either.
+ */
+ if (strcasecmp(ztypestr, "delegation-only") == 0) {
+ result = dns_view_adddelegationonly(view, origin);
+ goto cleanup;
+ }
+
+ /*
* Check for duplicates in the new zone table.
*/
result = dns_view_findzone(view, origin, &dupzone);
@@ -1416,6 +1437,16 @@ configure_zone(cfg_obj_t *config, cfg_obj_t *zconfig, cfg_obj_t *vconfig,
}
/*
+ * Stub and forward zones may also refer to delegation only points.
+ */
+ only = NULL;
+ if (cfg_map_get(zoptions, "delegation-only", &only) == ISC_R_SUCCESS)
+ {
+ if (cfg_obj_asboolean(only))
+ CHECK(dns_view_adddelegationonly(view, origin));
+ }
+
+ /*
* Configure the zone.
*/
CHECK(ns_zone_configure(config, vconfig, zconfig, aclconf, zone));