Built-ins from libdns were not easily accessible from command line.
/*
* Commandline arguments for named;
*/
-#define NAMED_MAIN_ARGS "46A:c:Cd:D:E:fFgL:M:m:n:N:p:sS:t:T:U:u:vVx:X:"
+#define NAMED_MAIN_ARGS "46A:c:Cd:D:E:fFgHL:M:m:n:N:p:sS:t:T:U:u:vVx:X:"
ISC_NORETURN void
named_main_earlyfatal(const char *format, ...) ISC_FORMAT_PRINTF(1, 2);
#include <dns/lib.h>
#include <dns/name.h>
#include <dns/resolver.h>
+#include <dns/rootns.h>
#include <dns/view.h>
#include <dlz/dlz_dlopen_driver.h>
named_g_logflags = ISC_LOG_PRINTTIME | ISC_LOG_ISO8601 |
ISC_LOG_TZINFO;
break;
+ case 'H':
+ printf("%s", dns_rootns_gethints());
+ exit(EXIT_SUCCESS);
case 'L':
named_g_logfile = isc_commandline_argument;
break;
This option runs the server in the foreground and forces all logging to ``stderr``.
+.. option:: -H
+
+ This option prints built-in root servers hints and exits.
+
.. option:: -L logfile
This option sets the log to the file ``logfile`` by default, instead of the system log.
isc_result_t
dns_rootns_create(isc_mem_t *mctx, dns_rdataclass_t rdclass,
const char *filename, dns_db_t **target);
+
+const char *
+dns_rootns_gethints(void);
+/*%
+ * Get built-in root NS hints
+ */
return result;
}
+
+const char *
+dns_rootns_gethints(void) {
+ return root_ns;
+}