ntpq.mdoc.in revision 280849
1.Dd February 4 2015
2.Dt NTPQ @NTPQ_MS@ User Commands
3.Os
4.\"  EDIT THIS FILE WITH CAUTION  (ntpq-opts.mdoc)
5.\"
6.\"  It has been AutoGen-ed  February  4, 2015 at 02:43:19 AM by AutoGen 5.18.5pre4
7.\"  From the definitions    ntpq-opts.def
8.\"  and the template file   agmdoc-cmd.tpl
9.Sh NAME
10.Nm ntpq
11.Nd standard NTP query program
12.Sh SYNOPSIS
13.Nm
14.\" Mixture of short (flag) options and long options
15.Op Fl flags
16.Op Fl flag Op Ar value
17.Op Fl \-option\-name Ns Oo Oo Ns "=| " Oc Ns Ar value Oc
18[ host ...]
19.Pp
20.Sh DESCRIPTION
21The
22.Nm
23utility program is used to query NTP servers which
24implement the standard NTP mode 6 control message formats defined
25in Appendix B of the NTPv3 specification RFC1305, requesting
26information about current state and/or changes in that state.
27The same formats are used in NTPv4, although some of the
28variables have changed and new ones added. The description on this
29page is for the NTPv4 variables.
30The program may be run either in interactive mode or controlled using
31command line arguments.
32Requests to read and write arbitrary
33variables can be assembled, with raw and pretty\-printed output
34options being available.
35The
36.Nm
37utility can also obtain and print a
38list of peers in a common format by sending multiple queries to the
39server.
40If one or more request options is included on the command line
41when
42.Nm
43is executed, each of the requests will be sent
44to the NTP servers running on each of the hosts given as command
45line arguments, or on localhost by default.
46If no request options
47are given,
48.Nm
49will attempt to read commands from the
50standard input and execute these on the NTP server running on the
51first host given on the command line, again defaulting to localhost
52when no other host is specified.
53The
54.Nm
55utility will prompt for
56commands if the standard input is a terminal device.
57.Nm
58uses NTP mode 6 packets to communicate with the
59NTP server, and hence can be used to query any compatible server on
60the network which permits it.
61Note that since NTP is a UDP protocol
62this communication will be somewhat unreliable, especially over
63large distances in terms of network topology.
64The
65.Nm
66utility makes
67one attempt to retransmit requests, and will time requests out if
68the remote host is not heard from within a suitable timeout
69time.
70Specifying a
71command line option other than
72.Fl i
73or
74.Fl n
75will
76cause the specified query (queries) to be sent to the indicated
77host(s) immediately.
78Otherwise,
79.Nm
80will attempt to read
81interactive format commands from the standard input.
82.Ss "Internal Commands"
83Interactive format commands consist of a keyword followed by zero
84to four arguments.
85Only enough characters of the full keyword to
86uniquely identify the command need be typed.
87A
88number of interactive format commands are executed entirely within
89the
90.Nm
91utility itself and do not result in NTP mode 6
92requests being sent to a server.
93These are described following.
94.Bl -tag -width "? [command_keyword]" -compact -offset indent
95.It Ic ? Op  Ar command_keyword
96.It Ic help Op Ar command_keyword
97A
98.Ql \&?
99by itself will print a list of all the command
100keywords known to this incarnation of
101.Nm .
102A
103.Ql \&?
104followed by a command keyword will print function and usage
105information about the command.
106This command is probably a better
107source of information about
108.Nm
109than this manual
110page.
111.It Ic addvars Ar variable_name Ns Xo Op Ic =value
112.Ic ...
113.Xc
114.It Ic rmvars Ar variable_name Ic ...
115.It Ic clearvars
116.It Ic showvars
117The data carried by NTP mode 6 messages consists of a list of
118items of the form
119.Ql variable_name=value ,
120where the
121.Ql =value
122is ignored, and can be omitted,
123in requests to the server to read variables.
124The
125.Nm
126utility maintains an internal list in which data to be included in control
127messages can be assembled, and sent using the
128.Ic readlist
129and
130.Ic writelist
131commands described below.
132The
133.Ic addvars
134command allows variables and their optional values to be added to
135the list.
136If more than one variable is to be added, the list should
137be comma\-separated and not contain white space.
138The
139.Ic rmvars
140command can be used to remove individual variables from the list,
141while the
142.Ic clearlist
143command removes all variables from the
144list.
145The
146.Ic showvars
147command displays the current list of optional variables.
148.It Ic authenticate Op yes | no
149Normally
150.Nm
151does not authenticate requests unless
152they are write requests.
153The command
154.Ql authenticate yes
155causes
156.Nm
157to send authentication with all requests it
158makes.
159Authenticated requests causes some servers to handle
160requests slightly differently, and can occasionally melt the CPU in
161fuzzballs if you turn authentication on before doing a
162.Ic peer
163display.
164The command
165.Ql authenticate
166causes
167.Nm
168to display whether or not
169.Nm
170is currently autheinticating requests.
171.It Ic cooked
172Causes output from query commands to be "cooked", so that
173variables which are recognized by
174.Nm
175will have their
176values reformatted for human consumption.
177Variables which
178.Nm
179thinks should have a decodable value but didn't are
180marked with a trailing
181.Ql \&? .
182.It Xo
183.Ic debug
184.Oo
185.Cm more |
186.Cm less |
187.Cm off
188.Oc
189.Xc
190With no argument, displays the current debug level.
191Otherwise, the debug level is changed to the indicated level.
192.It Ic delay Ar milliseconds
193Specify a time interval to be added to timestamps included in
194requests which require authentication.
195This is used to enable
196(unreliable) server reconfiguration over long delay network paths
197or between machines whose clocks are unsynchronized.
198Actually the
199server does not now require timestamps in authenticated requests,
200so this command may be obsolete.
201.It Ic exit
202Exit
203.Nm .
204.It Ic host Ar hostname
205Set the host to which future queries will be sent.
206.Ar hostname
207may be either a host name or a numeric address.
208.It Ic hostnames Op Cm yes | Cm no
209If
210.Cm yes
211is specified, host names are printed in
212information displays.
213If
214.Cm no
215is specified, numeric
216addresses are printed instead.
217The default is
218.Cm yes ,
219unless
220modified using the command line
221.Fl n
222switch.
223.It Ic keyid Ar keyid
224This command allows the specification of a key number to be
225used to authenticate configuration requests.
226This must correspond
227to a key number the server has been configured to use for this
228purpose.
229.It Ic keytype Xo Oo
230.Cm md5 |
231.Cm OpenSSLDigestType
232.Oc
233.Xc
234Specify the type of key to use for authenticating requests.
235.Cm md5
236is alway supported.
237If
238.Nm
239was built with OpenSSL support,
240any digest type supported by OpenSSL can also be provided.
241If no argument is given, the current
242.Ic keytype
243is displayed.
244.It Ic ntpversion Xo Oo
245.Cm 1 |
246.Cm 2 |
247.Cm 3 |
248.Cm 4
249.Oc
250.Xc
251Sets the NTP version number which
252.Nm
253claims in
254packets.
255Defaults to 3, and note that mode 6 control messages (and
256modes, for that matter) didn't exist in NTP version 1.
257There appear
258to be no servers left which demand version 1.
259With no argument, displays the current NTP version that will be used
260when communicating with servers.
261.It Ic passwd
262This command prompts you to type in a password (which will not
263be echoed) which will be used to authenticate configuration
264requests.
265The password must correspond to the key configured for
266use by the NTP server for this purpose if such requests are to be
267successful.
268.\" Not yet implemented.
269.\" .It Ic poll
270.\" .Op Ar n
271.\" .Op Ic verbose
272.\" Poll an NTP server in client mode
273.\" .Ar n
274.\" times.
275.It Ic quit
276Exit
277.Nm .
278.It Ic raw
279Causes all output from query commands is printed as received
280from the remote server.
281The only formating/interpretation done on
282the data is to transform nonascii data into a printable (but barely
283understandable) form.
284.It Ic timeout Ar milliseconds
285Specify a timeout period for responses to server queries.
286The
287default is about 5000 milliseconds.
288Note that since
289.Nm
290retries each query once after a timeout, the total waiting time for
291a timeout will be twice the timeout value set.
292.It Ic version
293Print the version of the
294.Nm
295program.
296.El
297.Ss "Control Message Commands"
298Association IDs are used to identify system, peer and clock variables.
299System variables are assigned an association ID of zero and system name space, while each association is assigned a nonzero association ID and peer namespace.
300Most control commands send a single mode\-6 message to the server and expect a single response message.
301The exceptions are the
302.Li peers
303command, which sends a series of messages,
304and the
305.Li mreadlist
306and
307.Li mreadvar
308commands, which iterate over a range of associations.
309.Bl -tag -width "something" -compact -offset indent
310.It Cm associations
311Display a list of mobilized associations in the form:
312.Dl ind assid status conf reach auth condition last_event cnt
313.Bl -column -offset indent ".Sy Variable" ".Sy Description"
314.It Sy String Ta Sy Description
315.It Li ind Ta index on this list
316.It Li assid Ta association ID
317.It Li status Ta peer status word
318.It Li conf Ta Li yes : persistent, Li no : ephemeral
319.It Li reach Ta Li yes : reachable, Li no : unreachable
320.It Li auth Ta Li ok , Li yes , Li bad and Li none
321.It Li condition Ta selection status (see the Li select field of the peer status word)
322.It Li last_event Ta event report (see the Li event field of the peer status word)
323.It Li cnt Ta event count (see the Li count field of the peer status word)
324.El
325.It Cm authinfo
326Display the authentication statistics.
327.It Cm clockvar Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
328.It Cm cv Ar assocID Oo Ar name Ns Oo Cm = Ns Ar value Oc Oc Op ...
329Display a list of clock variables for those associations supporting a reference clock.
330.It Cm :config Op ...
331Send the remainder of the command line, including whitespace, to the server as a run\-time configuration command in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is of course required.
332.It Cm config\-from\-file Ar filename
333Send the each line of
334.Ar filename
335to the server as run\-time configuration commands in the same format as a line in the configuration file. This command is experimental until further notice and clarification. Authentication is required.
336.It Ic ifstats
337Display statistics for each local network address. Authentication is required.
338.It Ic iostats
339Display network and reference clock I/O statistics.
340.It Ic kerninfo
341Display kernel loop and PPS statistics. As with other ntpq output, times are in milliseconds. The precision value displayed is in milliseconds as well, unlike the precision system variable.
342.It Ic lassociations
343Perform the same function as the associations command, except display mobilized and unmobilized associations.
344.It Ic lopeers Xo
345.Oo Ic \-4 |
346.Ic \-6
347.Oc
348.Xc
349Obtain and print a list of all peers and clients showing
350.Ar dstadr
351(associated with any given IP version).
352.It Ic lpeers Xo
353.Oo Ic \-4 |
354.Ic \-6
355.Oc
356.Xc
357Print a peer spreadsheet for the appropriate IP version(s).
358.Ar dstadr
359(associated with any given IP version).
360.It Ic monstats
361Display monitor facility statistics.
362.It Ic mrulist Oo Ic limited | Ic kod | Ic mincount Ns = Ns Ar count | Ic laddr Ns = Ns Ar localaddr | Ic sort Ns = Ns Ar sortorder | Ic resany Ns = Ns Ar hexmask | Ic resall Ns = Ns Ar hexmask Oc
363Obtain and print traffic counts collected and maintained by the monitor facility.
364With the exception of
365.Cm sort Ns = Ns Ar sortorder ,
366the options filter the list returned by
367.Cm ntpd.
368The
369.Cm limited
370and
371.Cm kod
372options return only entries representing client addresses from which the last packet received triggered either discarding or a KoD response.
373The
374.Cm mincount Ns = Ns Ar count
375option filters entries representing less than
376.Ar count
377packets.
378The
379.Cm laddr Ns = Ns Ar localaddr
380option filters entries for packets received on any local address other than
381.Ar localaddr .
382.Cm resany Ns = Ns Ar hexmask
383and
384.Cm resall Ns = Ns Ar hexmask
385filter entries containing none or less than all, respectively, of the bits in
386.Ar hexmask ,
387which must begin with
388.Cm 0x .
389The
390.Ar sortorder
391defaults to
392.Cm lstint
393and may be any of
394.Cm addr ,
395.Cm count ,
396.Cm avgint ,
397.Cm lstint ,
398or any of those preceded by a minus sign (hyphen) to reverse the sort order.
399The output columns are:
400.Bl -tag -width "something" -compact -offset indent
401.It Column
402Description
403.It Ic lstint
404Interval in s between the receipt of the most recent packet from this address and the completion of the retrieval of the MRU list by
405.Nm .
406.It Ic avgint
407Average interval in s between packets from this address.
408.It Ic rstr
409Restriction flags associated with this address.
410Most are copied unchanged from the matching
411.Ic restrict
412command, however 0x400 (kod) and 0x20 (limited) flags are cleared unless the last packet from this address triggered a rate control response.
413.It Ic r
414Rate control indicator, either
415a period,
416.Ic L
417or
418.Ic K
419for no rate control response,
420rate limiting by discarding, or rate limiting with a KoD response, respectively.
421.It Ic m
422Packet mode.
423.It Ic v
424Packet version number.
425.It Ic count
426Packets received from this address.
427.It Ic rport
428Source port of last packet from this address.
429.It Ic remote address
430DNS name, numeric address, or address followed by
431claimed DNS name which could not be verified in parentheses.
432.El
433.It Ic mreadvar assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
434.It Ic mrv assocID assocID Oo Ar variable_name Ns Oo = Ns Ar value Oc Oc ...
435Perform the same function as the
436.Ic readvar
437command, except for a range of association IDs.
438This range is determined from the association list cached by the most recent
439.Ic associations
440command.
441.It Ic opeers Xo
442.Oo Ic \-4 |
443.Ic \-6
444.Oc
445.Xc
446Obtain and print the old\-style list of all peers and clients showing
447.Ar dstadr
448(associated with any given IP version),
449rather than the
450.Ar refid .
451.It Ic passociations
452Perform the same function as the
453.Ic associations
454command,
455except that it uses previously stored data rather than making a new query.
456.It Ic peers
457Display a list of peers in the form:
458.Dl [tally]remote refid st t when pool reach delay offset jitter
459.Bl -tag -width "something" -compact -offset indent
460.It Variable
461Description
462.It Ic [tally]
463single\-character code indicating current value of the
464.Ic select
465field of the
466.Lk decode.html#peer "peer status word"
467.It Ic remote
468host name (or IP number) of peer.
469The value displayed will be truncated to 15 characters  unless the
470.Fl w
471flag is given, in which case the full value will be displayed
472on the first line,
473and the remaining data is displayed on the next line.
474.It Ic refid
475association ID or
476.Lk decode.html#kiss "'kiss code"
477.It Ic st
478stratum
479.It Ic t
480.Ic u :
481unicast or manycast client,
482.Ic b :
483broadcast or multicast client,
484.Ic l :
485local (reference clock),
486.Ic s :
487symmetric (peer),
488.Ic A :
489manycast server,
490.Ic B :
491broadcast server,
492.Ic M :
493multicast server
494.It Ic when
495sec/min/hr since last received packet
496.It Ic poll
497poll interval (log2 s)
498.It Ic reach
499reach shift register (octal)
500.It Ic delay
501roundtrip delay
502.It Ic offset
503offset of server relative to this host
504.It Ic jitter
505jitter
506.El
507.It Ic pstats Ar assocID
508Show the statistics for the peer with the given
509.Ar assocID .
510.It Ic readlist Ar assocID
511.It Ic rl Ar assocID
512Read the system or peer variables included in the variable list.
513.It Ic readvar Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
514.It Ic rv Ar assocID Ar name Ns Oo Ns = Ns Ar value Oc  Oo , ... Oc
515Display the specified variables.
516If
517.Ar assocID
518is zero, the variables are from the
519.Sx System Variables
520name space, otherwise they are from the
521.Sx Peer Variables
522name space.
523The
524.Ar assocID
525is required, as the same name can occur in both spaces.
526If no
527.Ar name
528is included, all operative variables in the name space are displayed.
529In this case only, if the
530.Ar assocID
531is omitted, it is assumed zero.
532Multiple names are specified with comma separators and without whitespace.
533Note that time values are represented in milliseconds
534and frequency values in parts\-per\-million (PPM).
535Some NTP timestamps are represented in the format
536YYYYMMDDTTTT ,
537where YYYY is the year,
538MM the month of year,
539DD the day of month and
540TTTT the time of day.
541.It Ic reslist
542Show the access control (restrict) list for
543.Nm .
544.It Ic saveconfig Ar filename
545Write the current configuration,
546including any runtime modifications given with
547.Ic :config
548or
549.Ic config\-from\-file ,
550to the ntpd host's file
551.Ar filename .
552This command will be rejected by the server unless
553.Lk miscopt.html#saveconfigdir "saveconfigdir"
554appears in the
555.Ic ntpd
556configuration file.
557.Ar filename
558can use
559.Xr strftime
560format specifies to substitute the current date and time, for example,
561.Ic q]saveconfig ntp\-%Y%m%d\-%H%M%S.confq] .
562The filename used is stored in system variable
563.Ic savedconfig .
564Authentication is required.
565.It Ic timerstats
566Display interval timer counters.
567.It Ic writelist Ar assocID
568Write the system or peer variables included in the variable list.
569.It Ic writevar Ar assocID Ar name Ns = Ns Ar value Op , ...
570Write the specified variables.
571If the
572.Ar assocID
573is zero, the variables are from the
574.Sx System Variables
575name space, otherwise they are from the
576.Sx Peer Variables
577name space.
578The
579.Ar assocID
580is required, as the same name can occur in both spaces.
581.It Ic sysinfo
582Display operational summary.
583.It Ic sysstats
584Print statistics counters maintained in the protocol module.
585.El
586.Ss Status Words and Kiss Codes
587The current state of the operating program is shown
588in a set of status words
589maintained by the system.
590Status information is also available on a per\-association basis.
591These words are displayed in the
592.Ic rv
593and
594.Ic as
595commands both in hexadecimal and in decoded short tip strings.
596The codes, tips and short explanations are documented on the
597.Lk decode.html "Event Messages and Status Words"
598page.
599The page also includes a list of system and peer messages,
600the code for the latest of which is included in the status word.
601.Pp
602Information resulting from protocol machine state transitions
603is displayed using an informal set of ASCII strings called
604.Lk decode.html#kiss "kiss codes" .
605The original purpose was for kiss\-o'\-death (KoD) packets
606sent by the server to advise the client of an unusual condition.
607They are now displayed, when appropriate,
608in the reference identifier field in various billboards.
609.Ss System Variables
610The following system variables appear in the
611.Ic rv
612billboard.
613Not all variables are displayed in some configurations.
614.Bl -tag -width "something" -compact -offset indent
615.It Variable
616Description
617.It Ic status
618.Lk decode.html#sys "system status word"
619.It Ic version
620NTP software version and build time
621.It Ic processor
622hardware platform and version
623.It Ic system
624operating system and version
625.It Ic leap
626leap warning indicator (0\-3)
627.It Ic stratum
628stratum (1\-15)
629.It Ic precision
630precision (log2 s)
631.It Ic rootdelay
632total roundtrip delay to the primary reference clock
633.It Ic rootdisp
634total dispersion to the primary reference clock
635.It Ic peer
636system peer association ID
637.It Ic tc
638time constant and poll exponent (log2 s) (3\-17)
639.It Ic mintc
640minimum time constant (log2 s) (3\-10)
641.It Ic clock
642date and time of day
643.It Ic refid
644reference ID or
645.Lk decode.html#kiss "kiss code"
646.It Ic reftime
647reference time
648.It Ic offset
649combined  offset of server relative to this host
650.It Ic sys_jitter
651combined system jitter
652.It Ic frequency
653frequency offset (PPM) relative to hardware clock
654.It Ic clk_wander
655clock frequency wander (PPM)
656.It Ic clk_jitter
657clock jitter
658.It Ic tai
659TAI\-UTC offset (s)
660.It Ic leapsec
661NTP seconds when the next leap second is/was inserted
662.It Ic expire
663NTP seconds when the NIST leapseconds file expires
664.El
665The jitter and wander statistics are exponentially\-weighted RMS averages.
666The system jitter is defined in the NTPv4 specification;
667the clock jitter statistic is computed by the clock discipline module.
668.Pp
669When the NTPv4 daemon is compiled with the OpenSSL software library,
670additional system variables are displayed,
671including some or all of the following,
672depending on the particular Autokey dance:
673.Bl -tag -width "something" -compact -offset indent
674.It Variable
675Description
676.It Ic host
677Autokey host name for this host
678.It Ic ident
679Autokey group name for this host
680.It Ic flags
681host flags  (see Autokey specification)
682.It Ic digest
683OpenSSL message digest algorithm
684.It Ic signature
685OpenSSL digest/signature scheme
686.It Ic update
687NTP seconds at last signature update
688.It Ic cert
689certificate subject, issuer and certificate flags
690.It Ic until
691NTP seconds when the certificate expires
692.El
693.Ss Peer Variables
694The following peer variables appear in the
695.Ic rv
696billboard for each association.
697Not all variables are displayed in some configurations.
698.Bl -tag -width "something" -compact -offset indent
699.It Variable
700Description
701.It Ic associd
702association ID
703.It Ic status
704.Lk decode.html#peer "peer status word"
705.It Ic srcadr
706source (remote) IP address
707.It Ic srcport
708source (remote) port
709.It Ic dstadr
710destination (local) IP address
711.It Ic dstport
712destination (local) port
713.It Ic leap
714leap indicator (0\-3)
715.It Ic stratum
716stratum (0\-15)
717.It Ic precision
718precision (log2 s)
719.It Ic rootdelay
720total roundtrip delay to the primary reference clock
721.It Ic rootdisp
722total root dispersion to the primary reference clock
723.It Ic refid
724reference ID or
725.Lk decode.html#kiss "kiss code"
726.It Ic reftime
727reference time
728.It Ic reach
729reach register (octal)
730.It Ic unreach
731unreach counter
732.It Ic hmode
733host mode (1\-6)
734.It Ic pmode
735peer mode (1\-5)
736.It Ic hpoll
737host poll exponent (log2 s) (3\-17)
738.It Ic ppoll
739peer poll exponent (log2 s) (3\-17)
740.It Ic headway
741headway (see
742.Lk rate.html "Rate Management and the Kiss\-o'\-Death Packet" )
743.It Ic flash
744.Lk decode.html#flash "flash status word"
745.It Ic offset
746filter offset
747.It Ic delay
748filter delay
749.It Ic dispersion
750filter dispersion
751.It Ic jitter
752filter jitter
753.It Ic ident
754Autokey group name for this association
755.It Ic bias
756unicast/broadcast bias
757.It Ic xleave
758interleave delay (see
759.Lk xleave.html "NTP Interleaved Modes" )
760.El
761The
762.Ic bias
763variable is calculated when the first broadcast packet is received
764after the calibration volley.
765It represents the offset of the broadcast subgraph relative to the unicast subgraph.
766The
767.Ic xleave
768variable appears only for the interleaved symmetric and interleaved modes.
769It represents the internal queuing, buffering and transmission delays
770for the preceding packet.
771.Pp
772When the NTPv4 daemon is compiled with the OpenSSL software library,
773additional peer variables are displayed, including the following:
774.Bl -tag -width "something" -compact -offset indent
775.It Variable
776Description
777.It Ic flags
778peer flags (see Autokey specification)
779.It Ic host
780Autokey server name
781.It Ic flags
782peer flags (see Autokey specification)
783.It Ic signature
784OpenSSL digest/signature scheme
785.It Ic initsequence
786initial key ID
787.It Ic initkey
788initial key index
789.It Ic timestamp
790Autokey signature timestamp
791.El
792.Ss Clock Variables
793The following clock variables appear in the
794.Ic cv
795billboard for each association with a reference clock.
796Not all variables are displayed in some configurations.
797.Bl -tag -width "something" -compact -offset indent
798.It Variable
799Description
800.It Ic associd
801association ID
802.It Ic status
803.Lk decode.html#clock "clock status word"
804.It Ic device
805device description
806.It Ic timecode
807ASCII time code string (specific to device)
808.It Ic poll
809poll messages sent
810.It Ic noreply
811no reply
812.It Ic badformat
813bad format
814.It Ic baddata
815bad date or time
816.It Ic fudgetime1
817fudge time 1
818.It Ic fudgetime2
819fudge time 2
820.It Ic stratum
821driver stratum
822.It Ic refid
823driver reference ID
824.It Ic flags
825driver flags
826.El
827.Sh "OPTIONS"
828.Bl -tag
829.It  Fl 4 , Fl \-ipv4 
830Force IPv4 DNS name resolution.
831This option must not appear in combination with any of the following options:
832ipv6.
833.sp
834Force DNS resolution of following host names on the command line
835to the IPv4 namespace.
836.It  Fl 6 , Fl \-ipv6 
837Force IPv6 DNS name resolution.
838This option must not appear in combination with any of the following options:
839ipv4.
840.sp
841Force DNS resolution of following host names on the command line
842to the IPv6 namespace.
843.It  Fl c Ar cmd , Fl \-command Ns = Ns Ar cmd 
844run a command and exit.
845This option may appear an unlimited number of times.
846.sp
847The following argument is interpreted as an interactive format command
848and is added to the list of commands to be executed on the specified
849host(s).
850.It  Fl d , Fl \-debug\-level 
851Increase debug verbosity level.
852This option may appear an unlimited number of times.
853.sp
854.It  Fl D Ar number , Fl \-set\-debug\-level Ns = Ns Ar number 
855Set the debug verbosity level.
856This option may appear an unlimited number of times.
857This option takes an integer number as its argument.
858.sp
859.It  Fl i , Fl \-interactive 
860Force ntpq to operate in interactive mode.
861This option must not appear in combination with any of the following options:
862command, peers.
863.sp
864Force \fBntpq\fP to operate in interactive mode.
865Prompts will be written to the standard output and
866commands read from the standard input.
867.It  Fl n , Fl \-numeric 
868numeric host addresses.
869.sp
870Output all host addresses in dotted\-quad numeric format rather than
871converting to the canonical host names. 
872.It  Fl \-old\-rv 
873Always output status line with readvar.
874.sp
875By default, \fBntpq\fP now suppresses the \fBassocid=...\fP
876line that precedes the output of \fBreadvar\fP
877(alias \fBrv\fP) when a single variable is requested, such as
878\fBntpq \-c "rv 0 offset"\fP.
879This option causes \fBntpq\fP to include both lines of output
880for a single\-variable \fBreadvar\fP.
881Using an environment variable to
882preset this option in a script will enable both older and
883newer \fBntpq\fP to behave identically in this regard.
884.It  Fl p , Fl \-peers 
885Print a list of the peers.
886This option must not appear in combination with any of the following options:
887interactive.
888.sp
889Print a list of the peers known to the server as well as a summary
890of their state. This is equivalent to the 'peers' interactive command.
891.It  Fl w , Fl \-wide 
892Display the full 'remote' value.
893.sp
894Display the full value of the 'remote' value.  If this requires
895more than 15 characters, display the full value, emit a newline,
896and continue the data display properly indented on the next line.
897.It Fl \&? , Fl \-help
898Display usage information and exit.
899.It Fl \&! , Fl \-more\-help
900Pass the extended usage information through a pager.
901.It Fl > Oo Ar cfgfile Oc , Fl \-save\-opts Oo Ns = Ns Ar cfgfile Oc
902Save the option state to \fIcfgfile\fP.  The default is the \fIlast\fP
903configuration file listed in the \fBOPTION PRESETS\fP section, below.
904The command will exit after updating the config file.
905.It Fl < Ar cfgfile , Fl \-load\-opts Ns = Ns Ar cfgfile , Fl \-no\-load\-opts
906Load options from \fIcfgfile\fP.
907The \fIno\-load\-opts\fP form will disable the loading
908of earlier config/rc/ini files.  \fI\-\-no\-load\-opts\fP is handled early,
909out of order.
910.It Fl \-version Op Brq Ar v|c|n
911Output version of program and exit.  The default mode is `v', a simple
912version.  The `c' mode will print copyright information and `n' will
913print the full copyright notice.
914.El
915.Sh "OPTION PRESETS"
916Any option that is not marked as \fInot presettable\fP may be preset
917by loading values from configuration ("RC" or ".INI") file(s) and values from
918environment variables named:
919.nf
920  \fBNTPQ_<option\-name>\fP or \fBNTPQ\fP
921.fi
922.ad
923The environmental presets take precedence (are processed later than)
924the configuration files.
925The \fIhomerc\fP files are "\fI$HOME\fP", and "\fI.\fP".
926If any of these are directories, then the file \fI.ntprc\fP
927is searched for within those directories.
928.Sh "ENVIRONMENT"
929See \fBOPTION PRESETS\fP for configuration environment variables.
930.Sh "FILES"
931See \fBOPTION PRESETS\fP for configuration files.
932.Sh "EXIT STATUS"
933One of the following exit values will be returned:
934.Bl -tag
935.It 0 " (EXIT_SUCCESS)"
936Successful program execution.
937.It 1 " (EXIT_FAILURE)"
938The operation failed or the command syntax was not valid.
939.It 66 " (EX_NOINPUT)"
940A specified configuration file could not be loaded.
941.It 70 " (EX_SOFTWARE)"
942libopts had an internal operational error.  Please report
943it to autogen\-users@lists.sourceforge.net.  Thank you.
944.El
945.Sh "AUTHORS"
946The University of Delaware and Network Time Foundation
947.Sh "COPYRIGHT"
948Copyright (C) 1992\-2015 The University of Delaware and Network Time Foundation all rights reserved.
949This program is released under the terms of the NTP license, <http://ntp.org/license>.
950.Sh "BUGS"
951Please send bug reports to: http://bugs.ntp.org, bugs@ntp.org
952.Sh "NOTES"
953This manual page was \fIAutoGen\fP\-erated from the \fBntpq\fP
954option definitions.
955