/*! \file */
+#include <defaultconfig.h>
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
static void
usage(void) {
fprintf(stderr,
- "usage: %s [-achijklvz] [-p [-x]] [-t directory] "
+ "usage: %s [-achijklvz] [-pe [-x]] [-t directory] "
"[named.conf]\n",
isc_commandline_progname);
exit(EXIT_SUCCESS);
bool load_zones = false;
bool list_zones = false;
bool print = false;
+ bool effective = false;
unsigned int flags = 0;
unsigned int parserflags = 0;
unsigned int checkflags = BIND_CHECK_PLUGINS | BIND_CHECK_ALGORITHMS;
/*
* Process memory debugging argument first.
*/
-#define CMDLINE_FLAGS "acdhijklm:nt:pvxz"
+#define CMDLINE_FLAGS "acdehijklm:nt:pvxz"
while ((c = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) {
switch (c) {
case 'm':
print = true;
break;
+ case 'e':
+ print = true;
+ effective = true;
+ break;
+
case 'v':
printf("%s\n", PACKAGE_VERSION);
result = ISC_R_SUCCESS;
CHECK(load_zones_fromconfig(config, list_zones));
}
+ if (effective) {
+ cfg_obj_t *effectiveconf = NULL;
+ cfg_obj_t *defaultconfig = NULL;
+ isc_buffer_t b;
+
+ isc_buffer_constinit(&b, common_named_defaultconf,
+ sizeof(common_named_defaultconf) - 1);
+ isc_buffer_add(&b, sizeof(common_named_defaultconf) - 1);
+
+ CHECK(cfg_parse_buffer(
+ isc_g_mctx, &b, __FILE__, 0, &cfg_type_namedconf,
+ CFG_PCTX_NODEPRECATED | CFG_PCTX_NOOBSOLETE |
+ CFG_PCTX_NOEXPERIMENTAL | CFG_PCTX_BUILTIN,
+ &defaultconfig));
+ effectiveconf = cfg_effective_config(config, defaultconfig);
+
+ cfg_obj_detach(&defaultconfig);
+ cfg_obj_detach(&config);
+ config = effectiveconf;
+ }
+
if (print) {
cfg_printx(config, flags, output, &result);
}
Synopsis
~~~~~~~~
-:program:`named-checkconf` [**-achjklnvz**] [**-p** [**-x** ]] [**-t** directory] {filename}
+:program:`named-checkconf` [**-achjklnvz**] [**-pe** [**-x** ]] [**-t** directory] {filename}
Description
~~~~~~~~~~~
a `named.conf` intended to be run on another machine with possibly a
different set of supported DNSSEC key algorithms.
+.. option:: -e
+
+ This option prints the effective server configuration that would
+ result from :iscman:`named.conf` and its included files, if no errors
+ were detected, in canonical form.
+
+ The effective configuration is the result of loading a configuration
+ file and applying it on top of the default settings for :iscman:`named`.
+ All configurable settings are included.
+
+ See also the :option:`-x` and :option:`-p` options.
+
+
.. option:: -h
This option prints the usage summary and exits.
.. option:: -p
- This option prints out the :iscman:`named.conf` and included files in canonical form if
- no errors were detected. See also the :option:`-x` option.
+ This option prints the contents of :iscman:`named.conf` and all
+ included files in canonical form, if no errors were detected. See also
+ the :option:`-x` and :option:`-e` options.
.. option:: -t directory