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