target @code{chronyd} is using for its command & monitoring connections.
This defaults to the compiled-in default; there would rarely be a need
to change this.
+@item -n
+This option disables resolving IP addresses to hostnames.
@item -4
With this option hostnames will be resolved only to IPv4 addresses.
@item -6
password:
@itemize @bullet
+@item @code{dns}
@item @code{exit}
@item @code{help}
@item @code{password}
* delete command:: Remove an NTP server or peer
* deny command :: Denying NTP client access
* deny all command:: Denying NTP client access
+* dns command:: Configure how are hostnames and IP addresses resolved
* dump command:: Dump measurement histories to files
* exit command:: Exit from chronyc
* help command:: Generate help summary
The effect of the allow command is identical to the @code{deny all}
directive in the configuration file (@pxref{deny directive}).
@c }}}
+@c {{{ dns
+@node dns command
+@subsubsection dns
+The @code{dns} command configures how are hostnames and IP addresses resolved in
+@code{chronyc}. IP addresses can be resolved to hostnames when printing results
+of @code{sources}, @code{sourcestats}, @code{tracking} and @code{clients}
+commands. Hostnames are resolved in commands that take an address as argument.
+
+There are five forms of the command:
+
+@table @code
+@item dns -n
+Disables resolving IP addresses to hostnames. Raw IP addresses will be
+displayed.
+@item dns +n
+Enables resolving IP addresses to hostnames. This is the default unless
+@code{chronyc} was started with @code{-n} option.
+@item dns -4
+Resolves hostnames only to IPv4 addresses.
+@item dns -6
+Resolves hostnames only to IPv6 addresses.
+@item dns -46
+Resolves hostnames to both address families. This is the default unless
+@code{chronyc} was started with @code{-4} or @code{-6} option.
+@end table
+@c }}}
@c {{{ dump
@node dump command
@subsubsection dump
/* ================================================== */
+static int
+process_cmd_dns(const char *line)
+{
+ if (!strncmp(line, "-46", 3)) {
+ DNS_SetAddressFamily(IPADDR_UNSPEC);
+ } else if (!strncmp(line, "-4", 2)) {
+ DNS_SetAddressFamily(IPADDR_INET4);
+ } else if (!strncmp(line, "-6", 2)) {
+ DNS_SetAddressFamily(IPADDR_INET6);
+ } else if (!strncmp(line, "-n", 2)) {
+ no_dns = 1;
+ } else if (!strncmp(line, "+n", 2)) {
+ no_dns = 0;
+ } else {
+ fprintf(stderr, "Unrecognized dns command\n");
+ return 0;
+ }
+ return 1;
+}
+
+/* ================================================== */
+
static int
process_line(char *line, int *quit)
{
} else if (!strncmp(p, "activity", 8)) {
ret = process_cmd_activity(p+8);
do_normal_submit = 0;
+ } else if (!strncmp(p, "dns ", 4)) {
+ ret = process_cmd_dns(p+4);
+ do_normal_submit = 0;
} else if (!strncmp(p, "help", 4)) {
do_normal_submit = 0;
give_help();