The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since
27c4f68dcc1 (part of effective
configuration changes).
The reason is that since
27c4f68dcc1, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. Those changes omitted
the `need_hints` bool that disabled the warning for the builtin view.
This commit silences the log message again.
&rootzone);
if (rootzone != NULL) {
dns_zone_detach(&rootzone);
- } else {
+ } else if (strcmp(view->name, "_bind") != 0 ||
+ view->rdclass != dns_rdataclass_chaos)
+ {
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"no root hints for view '%s'",
--- /dev/null
+/*
+ * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+ *
+ * SPDX-License-Identifier: MPL-2.0
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, you can obtain one at https://mozilla.org/MPL/2.0/.
+ *
+ * See the COPYRIGHT file distributed with this work for additional
+ * information regarding copyright ownership.
+ */
+options {
+ port @PORT@;
+ pid-file "named.pid";
+ listen-on { 10.53.0.1; };
+};
+
+key rndc_key {
+ secret "1234abcd8765";
+ algorithm @DEFAULT_HMAC@;
+};
+
+controls {
+ inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
+};
+
+view _bind {
+};
+
+view foo {
+};
+
+view bar ch {
+};
--- /dev/null
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# SPDX-License-Identifier: MPL-2.0
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+import isctest
+
+
+def test_nohintswarn_bindchaos(ns1):
+ found = True
+ try:
+ with ns1.watch_log_from_start(timeout=1) as watcher:
+ watcher.wait_for_line("no root hints for view '_bind'")
+ except isctest.log.watchlog.WatchLogTimeout:
+ found = False
+ assert found is False
+
+ with ns1.watch_log_from_start() as watcher:
+ watcher.wait_for_line("no root hints for view 'bar'")