2 .Dt NTPDC @NTPDC_MS@ User Commands
4 .\" EDIT THIS FILE WITH CAUTION (ntpdc-opts.mdoc)
6 .\" It has been AutoGen-ed June 2, 2016 at 07:36:58 AM by AutoGen 5.18.5
7 .\" From the definitions ntpdc-opts.def
8 .\" and the template file agmdoc-cmd.tpl
11 .Nd vendor-specific NTPD control program
14 .\" Mixture of short (flag) options and long options
16 .Op Fl flag Op Ar value
17 .Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
24 .Xr ntpq @NTPQ_MS@ instead \- it can do everything
26 used to do, and it does so using a much more sane interface.
29 is a utility program used to query
32 current state and to request changes in that state.
33 It uses NTP mode 7 control message formats described in the source code.
35 be run either in interactive mode or controlled using command line
37 Extensive state and statistics information is available
41 In addition, nearly all the
42 configuration options which can be specified at startup using
43 ntpd's configuration file may also be specified at run time using
48 Force IPv4 DNS name resolution.
49 This option must not appear in combination with any of the following options:
52 Force DNS resolution of following host names on the command line
53 to the IPv4 namespace.
55 Force IPv6 DNS name resolution.
56 This option must not appear in combination with any of the following options:
59 Force DNS resolution of following host names on the command line
60 to the IPv6 namespace.
61 .It Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd
62 run a command and exit.
63 This option may appear an unlimited number of times.
65 The following argument is interpreted as an interactive format command
66 and is added to the list of commands to be executed on the specified
68 .It Fl d , Fl \-debug\-level
69 Increase debug verbosity level.
70 This option may appear an unlimited number of times.
72 .It Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number
73 Set the debug verbosity level.
74 This option may appear an unlimited number of times.
75 This option takes an integer number as its argument.
77 .It Fl i , Fl \-interactive
78 Force ntpq to operate in interactive mode.
79 This option must not appear in combination with any of the following options:
80 command, listpeers, peers, showpeers.
82 Force ntpq to operate in interactive mode. Prompts will be written
83 to the standard output and commands read from the standard input.
84 .It Fl l , Fl \-listpeers
85 Print a list of the peers.
86 This option must not appear in combination with any of the following options:
89 Print a list of the peers known to the server as well as a summary of
90 their state. This is equivalent to the 'listpeers' interactive command.
91 .It Fl n , Fl \-numeric
92 numeric host addresses.
94 Output all host addresses in dotted\-quad numeric format rather than
95 converting to the canonical host names.
97 Print a list of the peers.
98 This option must not appear in combination with any of the following options:
101 Print a list of the peers known to the server as well as a summary
102 of their state. This is equivalent to the 'peers' interactive command.
103 .It Fl s , Fl \-showpeers
104 Show a list of the peers.
105 This option must not appear in combination with any of the following options:
108 Print a list of the peers known to the server as well as a summary
109 of their state. This is equivalent to the 'dmpeers' interactive command.
110 .It Fl \&? , Fl \-help
111 Display usage information and exit.
112 .It Fl \&! , Fl \-more\-help
113 Pass the extended usage information through a pager.
114 .It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
115 Save the option state to \fIcfgfile\fP. The default is the \fIlast\fP
116 configuration file listed in the \fBOPTION PRESETS\fP section, below.
117 The command will exit after updating the config file.
118 .It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
119 Load options from \fIcfgfile\fP.
120 The \fIno\-load\-opts\fP form will disable the loading
121 of earlier config/rc/ini files. \fI\-\-no\-load\-opts\fP is handled early,
123 .It Fl \-version Op Brq Ar v|c|n
124 Output version of program and exit. The default mode is `v', a simple
125 version. The `c' mode will print copyright information and `n' will
126 print the full copyright notice.
129 Any option that is not marked as \fInot presettable\fP may be preset
130 by loading values from configuration ("RC" or ".INI") file(s) and values from
131 environment variables named:
133 \fBNTPDC_<option\-name>\fP or \fBNTPDC\fP
136 The environmental presets take precedence (are processed later than)
137 the configuration files.
138 The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
139 If any of these are directories, then the file \fI.ntprc\fP
140 is searched for within those directories.
142 If one or more request options are included on the command line
145 is executed, each of the requests will be sent
146 to the NTP servers running on each of the hosts given as command
147 line arguments, or on localhost by default.
148 If no request options
151 will attempt to read commands from the
152 standard input and execute these on the NTP server running on the
153 first host given on the command line, again defaulting to localhost
154 when no other host is specified.
157 utility will prompt for
158 commands if the standard input is a terminal device.
162 utility uses NTP mode 7 packets to communicate with the
163 NTP server, and hence can be used to query any compatible server on
164 the network which permits it.
165 Note that since NTP is a UDP protocol
166 this communication will be somewhat unreliable, especially over
167 large distances in terms of network topology.
171 no attempt to retransmit requests, and will time requests out if
172 the remote host is not heard from within a suitable timeout
177 are specific to the particular
178 implementation of the
180 daemon and can be expected to
181 work only with this and maybe some previous versions of the daemon.
182 Requests from a remote
184 utility which affect the
185 state of the local server must be authenticated, which requires
186 both the remote program and local server share a common key and key
189 Note that in contexts where a host name is expected, a
191 qualifier preceding the host name forces DNS resolution to the IPv4 namespace,
194 qualifier forces DNS resolution to the IPv6 namespace.
195 Specifying a command line option other than
199 will cause the specified query (queries) to be sent to
200 the indicated host(s) immediately.
204 attempt to read interactive format commands from the standard
206 .Ss "Interactive Commands"
207 Interactive format commands consist of a keyword followed by zero
209 Only enough characters of the full keyword to
210 uniquely identify the command need be typed.
212 command is normally sent to the standard output, but optionally the
213 output of individual commands may be sent to a file by appending a
215 followed by a file name, to the command line.
217 A number of interactive format commands are executed entirely
220 utility itself and do not result in NTP
221 mode 7 requests being sent to a server.
224 .Bl -tag -width indent
225 .It Ic \&? Ar command_keyword
226 .It Ic help Ar command_keyword
229 will print a list of all the command
230 keywords known to this incarnation of
234 followed by a command keyword will print function and usage
235 information about the command.
236 This command is probably a better
237 source of information about
241 .It Ic delay Ar milliseconds
242 Specify a time interval to be added to timestamps included in
243 requests which require authentication.
244 This is used to enable
245 (unreliable) server reconfiguration over long delay network paths
246 or between machines whose clocks are unsynchronized.
248 server does not now require timestamps in authenticated requests,
249 so this command may be obsolete.
250 .It Ic host Ar hostname
251 Set the host to which future queries will be sent.
253 be either a host name or a numeric address.
254 .It Ic hostnames Op Cm yes | Cm no
257 is specified, host names are printed in
258 information displays.
261 is specified, numeric
262 addresses are printed instead.
266 modified using the command line
269 .It Ic keyid Ar keyid
270 This command allows the specification of a key number to be
271 used to authenticate configuration requests.
273 to a key number the server has been configured to use for this
279 This command prompts you to type in a password (which will not
280 be echoed) which will be used to authenticate configuration
282 The password must correspond to the key configured for
283 use by the NTP server for this purpose if such requests are to be
285 .It Ic timeout Ar milliseconds
286 Specify a timeout period for responses to server queries.
288 default is about 8000 milliseconds.
291 retries each query once after a timeout, the total waiting time for
292 a timeout will be twice the timeout value set.
294 .Ss "Control Message Commands"
295 Query commands result in NTP mode 7 packets containing requests for
296 information being sent to the server.
297 These are read\-only commands
298 in that they make no modification of the server configuration
300 .Bl -tag -width indent
302 Obtains and prints a brief list of the peers for which the
303 server is maintaining state.
304 These should include all configured
305 peer associations as well as those peers whose stratum is such that
306 they are considered by the server to be possible future
307 synchronization candidates.
309 Obtains a list of peers for which the server is maintaining
310 state, along with a summary of that state.
312 includes the address of the remote peer, the local interface
313 address (0.0.0.0 if a local address has yet to be determined), the
314 stratum of the remote peer (a stratum of 16 indicates the remote
315 peer is unsynchronized), the polling interval, in seconds, the
316 reachability register, in octal, and the current estimated delay,
317 offset and dispersion of the peer, all in seconds.
319 The character in the left margin indicates the mode this peer
320 entry is operating in.
323 denotes symmetric active, a
325 indicates symmetric passive, a
328 remote server is being polled in client mode, a
330 indicates that the server is broadcasting to this address, a
332 denotes that the remote peer is sending broadcasts and a
334 denotes that the remote peer is sending broadcasts and a
336 marks the peer the server is currently synchronizing
339 The contents of the host field may be one of four forms.
341 be a host name, an IP address, a reference clock implementation
342 name with its parameter or
343 .Fn REFCLK "implementation_number" "parameter" .
350 A slightly different peer summary list.
351 Identical to the output
354 command, except for the character in the
356 Characters only appear beside peers which were
357 included in the final stage of the clock selection algorithm.
360 indicates that this peer was cast off in the falseticker
363 indicates that the peer made it
367 denotes the peer the server is currently
369 .It Ic showpeer Ar peer_address Oo Ar ... Oc
370 Shows a detailed display of the current peer variables for one
372 Most of these values are described in the NTP
373 Version 2 specification.
374 .It Ic pstats Ar peer_address Oo Ar ... Oc
375 Show per\-peer statistic counters associated with the specified
377 .It Ic clockstat Ar clock_peer_address Oo Ar ... Oc
378 Obtain and print information concerning a peer clock.
380 values obtained provide information on the setting of fudge factors
381 and other clock performance information.
383 Obtain and print kernel phase\-lock loop operating parameters.
384 This information is available only if the kernel has been specially
385 modified for a precision timekeeping function.
386 .It Ic loopinfo Op Cm oneline | Cm multiline
387 Print the values of selected loop filter variables.
389 filter is the part of NTP which deals with adjusting the local
393 is the last offset given to the
394 loop filter by the packet processing code.
397 is the frequency error of the local clock in parts\-per\-million
401 controls the stiffness of the
402 phase\-lock loop and thus the speed at which it can adapt to
407 of seconds which have elapsed since the last sample offset was
408 given to the loop filter.
413 options specify the format in which this
414 information is to be printed, with
419 Print a variety of system state variables, i.e., state related
421 All except the last four lines are described
422 in the NTP Version 3 specification, RFC\-1305.
426 show various system flags, some of
427 which can be set and cleared by the
431 configuration commands, respectively.
444 documentation for the meaning of these flags.
446 are two additional flags which are read only, the
451 the synchronization status when the precision time kernel
452 modifications are in use.
456 the local clock is being disciplined by the kernel, while the
458 indicates the kernel discipline is provided by the PPS
463 is the residual frequency error remaining
464 after the system frequency correction is applied and is intended for
465 maintenance and debugging.
466 In most architectures, this value will
467 initially decrease from as high as 500 ppm to a nominal value in
468 the range .01 to 0.1 ppm.
469 If it remains high for some time after
470 starting the daemon, something may be wrong with the local clock,
471 or the value of the kernel variable
472 .Va kern.clockrate.tick
478 shows the default broadcast delay,
481 configuration command.
485 shows the default authentication delay,
488 configuration command.
490 Print statistics counters maintained in the protocol
493 Print statistics counters related to memory allocation
496 Print statistics counters maintained in the input\-output
499 Print statistics counters maintained in the timer/event queue
502 Obtain and print the server's restriction list.
504 (usually) printed in sorted order and may help to understand how
505 the restrictions are applied.
506 .It Ic monlist Op Ar version
507 Obtain and print traffic counts collected and maintained by the
509 The version number should not normally need to be
511 .It Ic clkbug Ar clock_peer_address Oo Ar ... Oc
512 Obtain debugging information for a reference clock driver.
514 information is provided only by some clock drivers and is mostly
515 undecodable without a copy of the driver source in hand.
517 .Ss "Runtime Configuration Requests"
518 All requests which cause state changes in the server are
519 authenticated by the server using a configured NTP key (the
520 facility can also be disabled by the server by not configuring a
522 The key number and the corresponding key must also be made
525 This can be done using the
529 commands, the latter of which will prompt at the terminal for a
530 password to use as the encryption key.
531 You will also be prompted
532 automatically for both the key number and password the first time a
533 command which would result in an authenticated request to the
535 Authentication not only provides verification that
536 the requester has permission to make such changes, but also gives
537 an extra degree of protection again transmission errors.
539 Authenticated requests always include a timestamp in the packet
540 data, which is included in the computation of the authentication
542 This timestamp is compared by the server to its receive time
544 If they differ by more than a small amount the request is
546 This is done for two reasons.
547 First, it makes simple
548 replay attacks on the server, by someone who might be able to
549 overhear traffic on your LAN, much more difficult.
551 it more difficult to request configuration changes to your server
552 from topologically remote hosts.
553 While the reconfiguration facility
554 will work well with a server on the local host, and may work
555 adequately between time\-synchronized hosts on the same LAN, it will
556 work very poorly for more distant hosts.
557 As such, if reasonable
558 passwords are chosen, care is taken in the distribution and
559 protection of keys and appropriate source address restrictions are
560 applied, the run time reconfiguration facility should provide an
561 adequate level of security.
563 The following commands all make authenticated requests.
564 .Bl -tag -width indent
565 .It Xo Ic addpeer Ar peer_address
570 Add a configured peer association at the given address and
571 operating in symmetric active mode.
572 Note that an existing
573 association with the same peer may be deleted when this command is
574 executed, or may simply be converted to conform to the new
575 configuration, as appropriate.
579 nonzero integer, all outgoing packets to the remote server will
580 have an authentication field attached encrypted with this key.
582 the value is 0 (or not given) no authentication will be done.
585 can be 1, 2 or 3 and defaults to 3.
588 keyword indicates a preferred peer (and thus will
589 be used primarily for clock synchronisation if possible).
591 preferred peer also determines the validity of the PPS signal \- if
592 the preferred peer is suitable for synchronisation so is the PPS
594 .It Xo Ic addserver Ar peer_address
599 Identical to the addpeer command, except that the operating
601 .It Xo Ic broadcast Ar peer_address
606 Identical to the addpeer command, except that the operating
608 In this case a valid key identifier and key are
612 parameter can be the broadcast
613 address of the local network or a multicast group address assigned
615 If a multicast address, a multicast\-capable kernel is
617 .It Ic unconfig Ar peer_address Oo Ar ... Oc
618 This command causes the configured bit to be removed from the
620 In many cases this will cause the peer
621 association to be deleted.
622 When appropriate, however, the
623 association may persist in an unconfigured mode if the remote peer
624 is willing to continue on in this fashion.
625 .It Xo Ic fudge Ar peer_address
631 This command provides a way to set certain data for a reference
633 See the source listing for further information.
636 .Cm auth | Cm bclient |
637 .Cm calibrate | Cm kernel |
638 .Cm monitor | Cm ntp |
644 .Cm auth | Cm bclient |
645 .Cm calibrate | Cm kernel |
646 .Cm monitor | Cm ntp |
650 These commands operate in the same way as the
654 configuration file commands of
656 .Bl -tag -width indent
658 Enables the server to synchronize with unconfigured peers only
659 if the peer has been correctly authenticated using either public key
660 or private key cryptography.
661 The default for this flag is enable.
663 Enables the server to listen for a message from a broadcast or
664 multicast server, as in the multicastclient command with
666 The default for this flag is disable.
668 Enables the calibrate feature for reference clocks.
669 The default for this flag is disable.
671 Enables the kernel time discipline, if available.
672 The default for this flag is enable if support is available, otherwise disable.
674 Enables the monitoring facility.
675 See the documentation here about the
677 command or further information.
678 The default for this flag is enable.
680 Enables time and frequency discipline.
681 In effect, this switch opens and closes the feedback loop,
682 which is useful for testing.
683 The default for this flag is enable.
685 Enables the pulse\-per\-second (PPS) signal when frequency
686 and time is disciplined by the precision time kernel modifications.
688 .Qq A Kernel Model for Precision Timekeeping
689 (available as part of the HTML documentation
691 .Pa /usr/share/doc/ntp )
692 page for further information.
693 The default for this flag is disable.
695 Enables the statistics facility.
697 .Sx Monitoring Options
700 for further information.
701 The default for this flag is disable.
703 .It Xo Ic restrict Ar address Ar mask
704 .Ar flag Oo Ar ... Oc
706 This command operates in the same way as the
708 configuration file commands of
710 .It Xo Ic unrestrict Ar address Ar mask
711 .Ar flag Oo Ar ... Oc
713 Unrestrict the matching entry from the restrict list.
714 .It Xo Ic delrestrict Ar address Ar mask
717 Delete the matching entry from the restrict list.
719 Causes the current set of authentication keys to be purged and
720 a new set to be obtained by rereading the keys file (which must
721 have been specified in the
725 allows encryption keys to be changed without restarting the
727 .It Ic trustedkey Ar keyid Oo Ar ... Oc
728 .It Ic untrustedkey Ar keyid Oo Ar ... Oc
729 These commands operate in the same way as the
737 Returns information concerning the authentication module,
738 including known keys and counts of encryptions and decryptions
739 which have been done.
741 Display the traps set in the server.
742 See the source listing for
744 .It Xo Ic addtrap Ar address
748 Set a trap for asynchronous messages.
749 See the source listing
750 for further information.
751 .It Xo Ic clrtrap Ar address
755 Clear a trap for asynchronous messages.
756 See the source listing
757 for further information.
759 Clear the statistics counters in various modules of the server.
760 See the source listing for further information.
763 See \fBOPTION PRESETS\fP for configuration environment variables.
765 See \fBOPTION PRESETS\fP for configuration files.
767 One of the following exit values will be returned:
769 .It 0 " (EXIT_SUCCESS)"
770 Successful program execution.
771 .It 1 " (EXIT_FAILURE)"
772 The operation failed or the command syntax was not valid.
773 .It 66 " (EX_NOINPUT)"
774 A specified configuration file could not be loaded.
775 .It 70 " (EX_SOFTWARE)"
776 libopts had an internal operational error. Please report
777 it to autogen\-users@lists.sourceforge.net. Thank you.
784 .%T Network Time Protocol (Version 3)
788 The formatting directives in this document came from FreeBSD.
790 Copyright (C) 1992\-2016 The University of Delaware and Network Time Foundation all rights reserved.
791 This program is released under the terms of the NTP license, <http://ntp.org/license>.
795 utility is a crude hack.
796 Much of the information it shows is
797 deadly boring and could only be loved by its implementer.
799 program was designed so that new (and temporary) features were easy
800 to hack in, at great expense to the program's ease of use.
802 this, the program is occasionally useful.
804 Please report bugs to http://bugs.ntp.org .
806 Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
808 This manual page was \fIAutoGen\fP\-erated from the \fBntpdc\fP