xref: /freebsd/contrib/ntp/ntpd/ntpd.html (revision 63d1fd5970ec814904aa0f4580b10a0d302d08b2)
1<html lang="en">
2<head>
3<title>ntpd: Network Time Protocol (NTP) Daemon User's Manual</title>
4<meta http-equiv="Content-Type" content="text/html">
5<meta name="description" content="ntpd: Network Time Protocol (NTP) Daemon User's Manual">
6<meta name="generator" content="makeinfo 4.7">
7<link title="Top" rel="top" href="#Top">
8<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9<meta http-equiv="Content-Style-Type" content="text/css">
10<style type="text/css"><!--
11  pre.display { font-family:inherit }
12  pre.format  { font-family:inherit }
13  pre.smalldisplay { font-family:inherit; font-size:smaller }
14  pre.smallformat  { font-family:inherit; font-size:smaller }
15  pre.smallexample { font-size:smaller }
16  pre.smalllisp    { font-size:smaller }
17  span.sc { font-variant:small-caps }
18  span.roman { font-family: serif; font-weight: normal; }
19--></style>
20</head>
21<body>
22<h1 class="settitle">ntpd: Network Time Protocol (NTP) Daemon User's Manual</h1>
23<div class="node">
24<p><hr>
25<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Description">ntpd Description</a>,
26Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
27Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
28<br>
29</div>
30
31<h2 class="unnumbered">ntpd: Network Time Protocol (NTP) Daemon User Manual</h2>
32
33<p>The <code>ntpd</code> program is an operating system daemon that synchronizes the
34system clock to remote NTP time servers or local reference clocks.
35It is a complete implementation of NTP version 4 defined by RFC-5905, but
36also retains compatible with version 3 defined by RFC-1305 and versions
371 and 2, defined by RFC-1059 and RFC-1119, respectively.
38The program can operate in any of several modes, including client/server,
39symmetric and broadcast modes, and with both symmetric-key and public-key
40cryptography.
41
42  <p>This document applies to version 4.2.8p9 of <code>ntpd</code>.
43
44<ul class="menu">
45<li><a accesskey="1" href="#ntpd-Description">ntpd Description</a>:             Description
46<li><a accesskey="2" href="#ntpd-Invocation">ntpd Invocation</a>: 		Invoking ntpd
47<li><a accesskey="3" href="#Usage">Usage</a>:                        Usage
48</ul>
49
50<div class="node">
51<p><hr>
52<a name="ntpd-Description"></a>
53<br>
54</div>
55
56<!-- node-name,  next,  previous,  up -->
57<h3 class="section">Description</h3>
58
59<p>The <code>ntpd</code> program ordinarily requires
60a configuration file described at <a href="#ntp_002econf">ntp.conf</a>.
61This configuration file contains configuration commands described on
62the pages listed above.
63However a client can discover remote servers and configure them
64automatically.
65This makes it possible to deploy a fleet of workstations without
66specifying configuration details specific to the local environment.
67
68  <p>The <code>ntpd</code> program normally operates continuously while adjusting the
69system time and frequency, but in some cases this might not be
70practical.
71With the <code>-q</code> option <code>ntpd</code> operates as in continuous mode, but
72exits just after setting the clock for the first time.
73Most applications will probably want to specify the <code>iburst</code>
74option with the <code>server</code> command.
75With this option an initial volley of messages is exchanged to
76groom the data and set the clock in about ten seconds' time.
77If nothing is heard after a few minutes' time,
78the daemon times out and exits without setting the clock.
79
80<div class="node">
81<p><hr>
82<a name="ntpd-Invocation"></a>
83<br>
84</div>
85
86<h3 class="section">Invoking ntpd</h3>
87
88<p><a name="index-ntpd-1"></a><a name="index-NTP-daemon-program-2"></a>
89
90  <p>The
91<code>ntpd</code>
92utility is an operating system daemon which sets
93and maintains the system time of day in synchronism with Internet
94standard time servers.
95It is a complete implementation of the
96Network Time Protocol (NTP) version 4, as defined by RFC-5905,
97but also retains compatibility with
98version 3, as defined by RFC-1305, and versions 1
99and 2, as defined by RFC-1059 and RFC-1119, respectively.
100
101  <p>The
102<code>ntpd</code>
103utility does most computations in 64-bit floating point
104arithmetic and does relatively clumsy 64-bit fixed point operations
105only when necessary to preserve the ultimate precision, about 232
106picoseconds.
107While the ultimate precision is not achievable with
108ordinary workstations and networks of today, it may be required
109with future gigahertz CPU clocks and gigabit LANs.
110
111  <p>Ordinarily,
112<code>ntpd</code>
113reads the
114<code>ntp.conf(5)</code>
115configuration file at startup time in order to determine the
116synchronization sources and operating modes.
117It is also possible to
118specify a working, although limited, configuration entirely on the
119command line, obviating the need for a configuration file.
120This may
121be particularly useful when the local host is to be configured as a
122broadcast/multicast client, with all peers being determined by
123listening to broadcasts at run time.
124
125  <p>If NetInfo support is built into
126<code>ntpd</code>
127then
128<code>ntpd</code>
129will attempt to read its configuration from the
130NetInfo if the default
131<code>ntp.conf(5)</code>
132file cannot be read and no file is
133specified by the
134<code>-c</code>
135option.
136
137  <p>Various internal
138<code>ntpd</code>
139variables can be displayed and
140configuration options altered while the
141<code>ntpd</code>
142is running
143using the
144<code>ntpq(1ntpqmdoc)</code>
145and
146<code>ntpdc(1ntpdcmdoc)</code>
147utility programs.
148
149  <p>When
150<code>ntpd</code>
151starts it looks at the value of
152<code>umask(2)</code>,
153and if zero
154<code>ntpd</code>
155will set the
156<code>umask(2)</code>
157to 022.
158
159  <p>This section was generated by <strong>AutoGen</strong>,
160using the <code>agtexi-cmd</code> template and the option descriptions for the <code>ntpd</code> program.
161This software is released under the NTP license, &lt;http://ntp.org/license&gt;.
162
163<ul class="menu">
164<li><a accesskey="1" href="#ntpd-usage">ntpd usage</a>:                   ntpd help/usage (<span class="option">--help</span>)
165<li><a accesskey="2" href="#ntpd-ipv4">ntpd ipv4</a>:                    ipv4 option (-4)
166<li><a accesskey="3" href="#ntpd-ipv6">ntpd ipv6</a>:                    ipv6 option (-6)
167<li><a accesskey="4" href="#ntpd-authreq">ntpd authreq</a>:                 authreq option (-a)
168<li><a accesskey="5" href="#ntpd-authnoreq">ntpd authnoreq</a>:               authnoreq option (-A)
169<li><a accesskey="6" href="#ntpd-configfile">ntpd configfile</a>:              configfile option (-c)
170<li><a accesskey="7" href="#ntpd-driftfile">ntpd driftfile</a>:               driftfile option (-f)
171<li><a accesskey="8" href="#ntpd-panicgate">ntpd panicgate</a>:               panicgate option (-g)
172<li><a accesskey="9" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>:         force-step-once option (-G)
173<li><a href="#ntpd-jaildir">ntpd jaildir</a>:                 jaildir option (-i)
174<li><a href="#ntpd-interface">ntpd interface</a>:               interface option (-I)
175<li><a href="#ntpd-keyfile">ntpd keyfile</a>:                 keyfile option (-k)
176<li><a href="#ntpd-logfile">ntpd logfile</a>:                 logfile option (-l)
177<li><a href="#ntpd-novirtualips">ntpd novirtualips</a>:            novirtualips option (-L)
178<li><a href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>:           modifymmtimer option (-M)
179<li><a href="#ntpd-nice">ntpd nice</a>:                    nice option (-N)
180<li><a href="#ntpd-pidfile">ntpd pidfile</a>:                 pidfile option (-p)
181<li><a href="#ntpd-priority">ntpd priority</a>:                priority option (-P)
182<li><a href="#ntpd-quit">ntpd quit</a>:                    quit option (-q)
183<li><a href="#ntpd-propagationdelay">ntpd propagationdelay</a>:        propagationdelay option (-r)
184<li><a href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>:          saveconfigquit option
185<li><a href="#ntpd-statsdir">ntpd statsdir</a>:                statsdir option (-s)
186<li><a href="#ntpd-trustedkey">ntpd trustedkey</a>:              trustedkey option (-t)
187<li><a href="#ntpd-user">ntpd user</a>:                    user option (-u)
188<li><a href="#ntpd-updateinterval">ntpd updateinterval</a>:          updateinterval option (-U)
189<li><a href="#ntpd-wait_002dsync">ntpd wait-sync</a>:               wait-sync option (-w)
190<li><a href="#ntpd-slew">ntpd slew</a>:                    slew option (-x)
191<li><a href="#ntpd-usepcc">ntpd usepcc</a>:                  usepcc option
192<li><a href="#ntpd-pccfreq">ntpd pccfreq</a>:                 pccfreq option
193<li><a href="#ntpd-mdns">ntpd mdns</a>:                    mdns option (-m)
194<li><a href="#ntpd-config">ntpd config</a>:                  presetting/configuring ntpd
195<li><a href="#ntpd-exit-status">ntpd exit status</a>:             exit status
196<li><a href="#ntpd-Usage">ntpd Usage</a>:                   Usage
197<li><a href="#ntpd-Files">ntpd Files</a>:                   Files
198<li><a href="#ntpd-See-Also">ntpd See Also</a>:                See Also
199<li><a href="#ntpd-Bugs">ntpd Bugs</a>:                    Bugs
200<li><a href="#ntpd-Notes">ntpd Notes</a>:                   Notes
201</ul>
202
203<div class="node">
204<p><hr>
205<a name="ntpd-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-ipv4">ntpd ipv4</a>,
206Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
207<br>
208</div>
209
210<h4 class="subsection">ntpd help/usage (<span class="option">--help</span>)</h4>
211
212<p><a name="index-ntpd-help-3"></a>
213This is the automatically generated usage text for ntpd.
214
215  <p>The text printed is the same whether selected with the <code>help</code> option
216(<span class="option">--help</span>) or the <code>more-help</code> option (<span class="option">--more-help</span>).  <code>more-help</code> will print
217the usage text by passing it through a pager program.
218<code>more-help</code> is disabled on platforms without a working
219<code>fork(2)</code> function.  The <code>PAGER</code> environment variable is
220used to select the program, defaulting to <span class="file">more</span>.  Both will exit
221with a status code of 0.
222
223<pre class="example">ntpd - NTP daemon program - Ver. 4.2.8p9-RC
224Usage:  ntpd [ -&lt;flag&gt; [&lt;val&gt;] | --&lt;name&gt;[{=| }&lt;val&gt;] ]... \
225                [ &lt;server1&gt; ... &lt;serverN&gt; ]
226  Flg Arg Option-Name    Description
227   -4 no  ipv4           Force IPv4 DNS name resolution
228                                - prohibits the option 'ipv6'
229   -6 no  ipv6           Force IPv6 DNS name resolution
230                                - prohibits the option 'ipv4'
231   -a no  authreq        Require crypto authentication
232                                - prohibits the option 'authnoreq'
233   -A no  authnoreq      Do not require crypto authentication
234                                - prohibits the option 'authreq'
235   -b no  bcastsync      Allow us to sync to broadcast servers
236   -c Str configfile     configuration file name
237   -d no  debug-level    Increase debug verbosity level
238                                - may appear multiple times
239   -D Num set-debug-level Set the debug verbosity level
240                                - may appear multiple times
241   -f Str driftfile      frequency drift file name
242   -g no  panicgate      Allow the first adjustment to be Big
243                                - may appear multiple times
244   -G no  force-step-once Step any initial offset correction.
245   -i Str jaildir        Jail directory
246   -I Str interface      Listen on an interface name or address
247                                - may appear multiple times
248   -k Str keyfile        path to symmetric keys
249   -l Str logfile        path to the log file
250   -L no  novirtualips   Do not listen to virtual interfaces
251   -n no  nofork         Do not fork
252                                - prohibits the option 'wait-sync'
253   -N no  nice           Run at high priority
254   -p Str pidfile        path to the PID file
255   -P Num priority       Process priority
256   -q no  quit           Set the time and quit
257                                - prohibits these options:
258                                saveconfigquit
259                                wait-sync
260   -r Str propagationdelay Broadcast/propagation delay
261      Str saveconfigquit Save parsed configuration and quit
262                                - prohibits these options:
263                                quit
264                                wait-sync
265   -s Str statsdir       Statistics file location
266   -t Str trustedkey     Trusted key number
267                                - may appear multiple times
268   -u Str user           Run as userid (or userid:groupid)
269   -U Num updateinterval interval in seconds between scans for new or dropped interfaces
270      Str var            make ARG an ntp variable (RW)
271                                - may appear multiple times
272      Str dvar           make ARG an ntp variable (RW|DEF)
273                                - may appear multiple times
274   -w Num wait-sync      Seconds to wait for first clock sync
275                                - prohibits these options:
276                                nofork
277                                quit
278                                saveconfigquit
279   -x no  slew           Slew up to 600 seconds
280      opt version        output version information and exit
281   -? no  help           display extended usage information and exit
282   -! no  more-help      extended usage information passed thru pager
283
284Options are specified by doubled hyphens and their name or by a single
285hyphen and the flag character.
286
287
288The following option preset mechanisms are supported:
289 - examining environment variables named NTPD_*
290
291Please send bug reports to:  &lt;http://bugs.ntp.org, bugs@ntp.org&gt;
292</pre>
293  <div class="node">
294<p><hr>
295<a name="ntpd-ipv4"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-ipv6">ntpd ipv6</a>,
296Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usage">ntpd usage</a>,
297Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
298<br>
299</div>
300
301<h4 class="subsection">ipv4 option (-4)</h4>
302
303<p><a name="index-ntpd_002dipv4-4"></a>
304This is the &ldquo;force ipv4 dns name resolution&rdquo; option.
305
306<p class="noindent">This option has some usage constraints.  It:
307     <ul>
308<li>must not appear in combination with any of the following options:
309ipv6.
310</ul>
311
312  <p>Force DNS resolution of following host names on the command line
313to the IPv4 namespace.
314<div class="node">
315<p><hr>
316<a name="ntpd-ipv6"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authreq">ntpd authreq</a>,
317Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv4">ntpd ipv4</a>,
318Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
319<br>
320</div>
321
322<h4 class="subsection">ipv6 option (-6)</h4>
323
324<p><a name="index-ntpd_002dipv6-5"></a>
325This is the &ldquo;force ipv6 dns name resolution&rdquo; option.
326
327<p class="noindent">This option has some usage constraints.  It:
328     <ul>
329<li>must not appear in combination with any of the following options:
330ipv4.
331</ul>
332
333  <p>Force DNS resolution of following host names on the command line
334to the IPv6 namespace.
335<div class="node">
336<p><hr>
337<a name="ntpd-authreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-authnoreq">ntpd authnoreq</a>,
338Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-ipv6">ntpd ipv6</a>,
339Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
340<br>
341</div>
342
343<h4 class="subsection">authreq option (-a)</h4>
344
345<p><a name="index-ntpd_002dauthreq-6"></a>
346This is the &ldquo;require crypto authentication&rdquo; option.
347
348<p class="noindent">This option has some usage constraints.  It:
349     <ul>
350<li>must not appear in combination with any of the following options:
351authnoreq.
352</ul>
353
354  <p>Require cryptographic authentication for broadcast client,
355multicast client and symmetric passive associations.
356This is the default.
357<div class="node">
358<p><hr>
359<a name="ntpd-authnoreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-configfile">ntpd configfile</a>,
360Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authreq">ntpd authreq</a>,
361Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
362<br>
363</div>
364
365<h4 class="subsection">authnoreq option (-A)</h4>
366
367<p><a name="index-ntpd_002dauthnoreq-7"></a>
368This is the &ldquo;do not require crypto authentication&rdquo; option.
369
370<p class="noindent">This option has some usage constraints.  It:
371     <ul>
372<li>must not appear in combination with any of the following options:
373authreq.
374</ul>
375
376  <p>Do not require cryptographic authentication for broadcast client,
377multicast client and symmetric passive associations.
378This is almost never a good idea.
379<div class="node">
380<p><hr>
381<a name="ntpd-configfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-driftfile">ntpd driftfile</a>,
382Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-authnoreq">ntpd authnoreq</a>,
383Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
384<br>
385</div>
386
387<h4 class="subsection">configfile option (-c)</h4>
388
389<p><a name="index-ntpd_002dconfigfile-8"></a>
390This is the &ldquo;configuration file name&rdquo; option.
391This option takes a string argument.
392The name and path of the configuration file,
393<span class="file">/etc/ntp.conf</span>
394by default.
395<div class="node">
396<p><hr>
397<a name="ntpd-driftfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-panicgate">ntpd panicgate</a>,
398Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-configfile">ntpd configfile</a>,
399Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
400<br>
401</div>
402
403<h4 class="subsection">driftfile option (-f)</h4>
404
405<p><a name="index-ntpd_002ddriftfile-9"></a>
406This is the &ldquo;frequency drift file name&rdquo; option.
407This option takes a string argument.
408The name and path of the frequency file,
409<span class="file">/etc/ntp.drift</span>
410by default.
411This is the same operation as the
412<code>driftfile</code> <kbd>driftfile</kbd>
413configuration specification in the
414<span class="file">/etc/ntp.conf</span>
415file.
416<div class="node">
417<p><hr>
418<a name="ntpd-panicgate"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
419Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-driftfile">ntpd driftfile</a>,
420Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
421<br>
422</div>
423
424<h4 class="subsection">panicgate option (-g)</h4>
425
426<p><a name="index-ntpd_002dpanicgate-10"></a>
427This is the &ldquo;allow the first adjustment to be big&rdquo; option.
428
429<p class="noindent">This option has some usage constraints.  It:
430     <ul>
431<li>may appear an unlimited number of times.
432</ul>
433
434  <p>Normally,
435<code>ntpd</code>
436exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that,
437<code>ntpd</code>
438will exit with a message to the system log. This option can be used with the
439<code>-q</code>
440and
441<code>-x</code>
442options.
443See the
444<code>tinker</code>
445configuration file directive for other options.
446<div class="node">
447<p><hr>
448<a name="ntpd-force_002dstep_002donce"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-jaildir">ntpd jaildir</a>,
449Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-panicgate">ntpd panicgate</a>,
450Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
451<br>
452</div>
453
454<h4 class="subsection">force-step-once option (-G)</h4>
455
456<p><a name="index-ntpd_002dforce_002dstep_002donce-11"></a>
457This is the &ldquo;step any initial offset correction.&rdquo; option.
458Normally,
459<code>ntpd</code>
460steps the time if the time offset exceeds the step threshold,
461which is 128 ms by default, and otherwise slews the time.
462This option forces the initial offset correction to be stepped,
463so the highest time accuracy can be achieved quickly.
464However, this may also cause the time to be stepped back
465so this option must not be used if
466applications requiring monotonic time are running.
467See the <code>tinker</code> configuration file directive for other options.
468<div class="node">
469<p><hr>
470<a name="ntpd-jaildir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-interface">ntpd interface</a>,
471Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-force_002dstep_002donce">ntpd force-step-once</a>,
472Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
473<br>
474</div>
475
476<h4 class="subsection">jaildir option (-i)</h4>
477
478<p><a name="index-ntpd_002djaildir-12"></a>
479This is the &ldquo;jail directory&rdquo; option.
480This option takes a string argument.
481
482<p class="noindent">This option has some usage constraints.  It:
483     <ul>
484<li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
485</ul>
486
487  <p>Chroot the server to the directory
488<kbd>jaildir</kbd>
489.
490This option also implies that the server attempts to drop root privileges at startup.
491You may need to also specify a
492<code>-u</code>
493option.
494This option is only available if the OS supports adjusting the clock
495without full root privileges.
496This option is supported under NetBSD (configure with
497<code>--enable-clockctl</code>) or Linux (configure with
498<code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
499<div class="node">
500<p><hr>
501<a name="ntpd-interface"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-keyfile">ntpd keyfile</a>,
502Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-jaildir">ntpd jaildir</a>,
503Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
504<br>
505</div>
506
507<h4 class="subsection">interface option (-I)</h4>
508
509<p><a name="index-ntpd_002dinterface-13"></a>
510This is the &ldquo;listen on an interface name or address&rdquo; option.
511This option takes a string argument <span class="file">iface</span>.
512
513<p class="noindent">This option has some usage constraints.  It:
514     <ul>
515<li>may appear an unlimited number of times.
516</ul>
517
518  <p>Open the network address given, or all the addresses associated with the
519given interface name.  This option may appear multiple times.  This option
520also implies not opening other addresses, except wildcard and localhost.
521This option is deprecated. Please consider using the configuration file
522<code>interface</code> command, which is more versatile.
523<div class="node">
524<p><hr>
525<a name="ntpd-keyfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-logfile">ntpd logfile</a>,
526Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-interface">ntpd interface</a>,
527Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
528<br>
529</div>
530
531<h4 class="subsection">keyfile option (-k)</h4>
532
533<p><a name="index-ntpd_002dkeyfile-14"></a>
534This is the &ldquo;path to symmetric keys&rdquo; option.
535This option takes a string argument.
536Specify the name and path of the symmetric key file.
537<span class="file">/etc/ntp.keys</span>
538is the default.
539This is the same operation as the
540<code>keys</code> <kbd>keyfile</kbd>
541configuration file directive.
542<div class="node">
543<p><hr>
544<a name="ntpd-logfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-novirtualips">ntpd novirtualips</a>,
545Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-keyfile">ntpd keyfile</a>,
546Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
547<br>
548</div>
549
550<h4 class="subsection">logfile option (-l)</h4>
551
552<p><a name="index-ntpd_002dlogfile-15"></a>
553This is the &ldquo;path to the log file&rdquo; option.
554This option takes a string argument.
555Specify the name and path of the log file.
556The default is the system log file.
557This is the same operation as the
558<code>logfile</code> <kbd>logfile</kbd>
559configuration file directive.
560<div class="node">
561<p><hr>
562<a name="ntpd-novirtualips"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
563Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-logfile">ntpd logfile</a>,
564Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
565<br>
566</div>
567
568<h4 class="subsection">novirtualips option (-L)</h4>
569
570<p><a name="index-ntpd_002dnovirtualips-16"></a>
571This is the &ldquo;do not listen to virtual interfaces&rdquo; option.
572Do not listen to virtual interfaces, defined as those with
573names containing a colon.  This option is deprecated.  Please
574consider using the configuration file <code>interface</code> command, which
575is more versatile.
576<div class="node">
577<p><hr>
578<a name="ntpd-modifymmtimer"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-nice">ntpd nice</a>,
579Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-novirtualips">ntpd novirtualips</a>,
580Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
581<br>
582</div>
583
584<h4 class="subsection">modifymmtimer option (-M)</h4>
585
586<p><a name="index-ntpd_002dmodifymmtimer-17"></a>
587This is the &ldquo;modify multimedia timer (windows only)&rdquo; option.
588
589<p class="noindent">This option has some usage constraints.  It:
590     <ul>
591<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
592</ul>
593
594  <p>Set the Windows Multimedia Timer to highest resolution.  This
595ensures the resolution does not change while ntpd is running,
596avoiding timekeeping glitches associated with changes.
597<div class="node">
598<p><hr>
599<a name="ntpd-nice"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pidfile">ntpd pidfile</a>,
600Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-modifymmtimer">ntpd modifymmtimer</a>,
601Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
602<br>
603</div>
604
605<h4 class="subsection">nice option (-N)</h4>
606
607<p><a name="index-ntpd_002dnice-18"></a>
608This is the &ldquo;run at high priority&rdquo; option.
609To the extent permitted by the operating system, run
610<code>ntpd</code>
611at the highest priority.
612<div class="node">
613<p><hr>
614<a name="ntpd-pidfile"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-priority">ntpd priority</a>,
615Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-nice">ntpd nice</a>,
616Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
617<br>
618</div>
619
620<h4 class="subsection">pidfile option (-p)</h4>
621
622<p><a name="index-ntpd_002dpidfile-19"></a>
623This is the &ldquo;path to the pid file&rdquo; option.
624This option takes a string argument.
625Specify the name and path of the file used to record
626<code>ntpd</code>'s
627process ID.
628This is the same operation as the
629<code>pidfile</code> <kbd>pidfile</kbd>
630configuration file directive.
631<div class="node">
632<p><hr>
633<a name="ntpd-priority"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-quit">ntpd quit</a>,
634Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pidfile">ntpd pidfile</a>,
635Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
636<br>
637</div>
638
639<h4 class="subsection">priority option (-P)</h4>
640
641<p><a name="index-ntpd_002dpriority-20"></a>
642This is the &ldquo;process priority&rdquo; option.
643This option takes a number argument.
644To the extent permitted by the operating system, run
645<code>ntpd</code>
646at the specified
647<code>sched_setscheduler(SCHED_FIFO)</code>
648priority.
649<div class="node">
650<p><hr>
651<a name="ntpd-quit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
652Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-priority">ntpd priority</a>,
653Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
654<br>
655</div>
656
657<h4 class="subsection">quit option (-q)</h4>
658
659<p><a name="index-ntpd_002dquit-21"></a>
660This is the &ldquo;set the time and quit&rdquo; option.
661
662<p class="noindent">This option has some usage constraints.  It:
663     <ul>
664<li>must not appear in combination with any of the following options:
665saveconfigquit, wait-sync.
666</ul>
667
668  <p><code>ntpd</code>
669will not daemonize and will exit after the clock is first
670synchronized.  This behavior mimics that of the
671<code>ntpdate</code>
672program, which will soon be replaced with a shell script.
673The
674<code>-g</code>
675and
676<code>-x</code>
677options can be used with this option.
678Note: The kernel time discipline is disabled with this option.
679<div class="node">
680<p><hr>
681<a name="ntpd-propagationdelay"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
682Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-quit">ntpd quit</a>,
683Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
684<br>
685</div>
686
687<h4 class="subsection">propagationdelay option (-r)</h4>
688
689<p><a name="index-ntpd_002dpropagationdelay-22"></a>
690This is the &ldquo;broadcast/propagation delay&rdquo; option.
691This option takes a string argument.
692Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.
693<div class="node">
694<p><hr>
695<a name="ntpd-saveconfigquit"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-statsdir">ntpd statsdir</a>,
696Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-propagationdelay">ntpd propagationdelay</a>,
697Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
698<br>
699</div>
700
701<h4 class="subsection">saveconfigquit option</h4>
702
703<p><a name="index-ntpd_002dsaveconfigquit-23"></a>
704This is the &ldquo;save parsed configuration and quit&rdquo; option.
705This option takes a string argument.
706
707<p class="noindent">This option has some usage constraints.  It:
708     <ul>
709<li>must be compiled in by defining <code>SAVECONFIG</code> during the compilation.
710<li>must not appear in combination with any of the following options:
711quit, wait-sync.
712</ul>
713
714  <p>Cause <code>ntpd</code> to parse its startup configuration file and save an
715equivalent to the given filename and exit.  This option was
716designed for automated testing.
717<div class="node">
718<p><hr>
719<a name="ntpd-statsdir"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-trustedkey">ntpd trustedkey</a>,
720Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-saveconfigquit">ntpd saveconfigquit</a>,
721Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
722<br>
723</div>
724
725<h4 class="subsection">statsdir option (-s)</h4>
726
727<p><a name="index-ntpd_002dstatsdir-24"></a>
728This is the &ldquo;statistics file location&rdquo; option.
729This option takes a string argument.
730Specify the directory path for files created by the statistics facility.
731This is the same operation as the
732<code>statsdir</code> <kbd>statsdir</kbd>
733configuration file directive.
734<div class="node">
735<p><hr>
736<a name="ntpd-trustedkey"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-user">ntpd user</a>,
737Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-statsdir">ntpd statsdir</a>,
738Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
739<br>
740</div>
741
742<h4 class="subsection">trustedkey option (-t)</h4>
743
744<p><a name="index-ntpd_002dtrustedkey-25"></a>
745This is the &ldquo;trusted key number&rdquo; option.
746This option takes a string argument <span class="file">tkey</span>.
747
748<p class="noindent">This option has some usage constraints.  It:
749     <ul>
750<li>may appear an unlimited number of times.
751</ul>
752
753  <p>Add the specified key number to the trusted key list.
754<div class="node">
755<p><hr>
756<a name="ntpd-user"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-updateinterval">ntpd updateinterval</a>,
757Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-trustedkey">ntpd trustedkey</a>,
758Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
759<br>
760</div>
761
762<h4 class="subsection">user option (-u)</h4>
763
764<p><a name="index-ntpd_002duser-26"></a>
765This is the &ldquo;run as userid (or userid:groupid)&rdquo; option.
766This option takes a string argument.
767
768<p class="noindent">This option has some usage constraints.  It:
769     <ul>
770<li>must be compiled in by defining <code>HAVE_DROPROOT</code> during the compilation.
771</ul>
772
773  <p>Specify a user, and optionally a group, to switch to.
774This option is only available if the OS supports adjusting the clock
775without full root privileges.
776This option is supported under NetBSD (configure with
777<code>--enable-clockctl</code>) or Linux (configure with
778<code>--enable-linuxcaps</code>) or Solaris (configure with <code>--enable-solarisprivs</code>).
779<div class="node">
780<p><hr>
781<a name="ntpd-updateinterval"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
782Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-user">ntpd user</a>,
783Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
784<br>
785</div>
786
787<h4 class="subsection">updateinterval option (-U)</h4>
788
789<p><a name="index-ntpd_002dupdateinterval-27"></a>
790This is the &ldquo;interval in seconds between scans for new or dropped interfaces&rdquo; option.
791This option takes a number argument.
792Give the time in seconds between two scans for new or dropped interfaces.
793For systems with routing socket support the scans will be performed shortly after the interface change
794has been detected by the system.
795Use 0 to disable scanning. 60 seconds is the minimum time between scans.
796<div class="node">
797<p><hr>
798<a name="ntpd-wait_002dsync"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-slew">ntpd slew</a>,
799Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-updateinterval">ntpd updateinterval</a>,
800Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
801<br>
802</div>
803
804<h4 class="subsection">wait-sync option (-w)</h4>
805
806<p><a name="index-ntpd_002dwait_002dsync-28"></a>
807This is the &ldquo;seconds to wait for first clock sync&rdquo; option.
808This option takes a number argument.
809
810<p class="noindent">This option has some usage constraints.  It:
811     <ul>
812<li>must be compiled in by defining <code>HAVE_WORKING_FORK</code> during the compilation.
813<li>must not appear in combination with any of the following options:
814nofork, quit, saveconfigquit.
815</ul>
816
817  <p>If greater than zero, alters <code>ntpd</code>'s behavior when forking to
818daemonize.  Instead of exiting with status 0 immediately after
819the fork, the parent waits up to the specified number of
820seconds for the child to first synchronize the clock.  The exit
821status is zero (success) if the clock was synchronized,
822otherwise it is <code>ETIMEDOUT</code>.
823This provides the option for a script starting <code>ntpd</code> to easily
824wait for the first set of the clock before proceeding.
825<div class="node">
826<p><hr>
827<a name="ntpd-slew"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-usepcc">ntpd usepcc</a>,
828Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-wait_002dsync">ntpd wait-sync</a>,
829Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
830<br>
831</div>
832
833<h4 class="subsection">slew option (-x)</h4>
834
835<p><a name="index-ntpd_002dslew-29"></a>
836This is the &ldquo;slew up to 600 seconds&rdquo; option.
837Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold.
838This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually.
839Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s.
840Thus, an adjustment as much as 600 s will take almost 14 days to complete.
841This option can be used with the
842<code>-g</code>
843and
844<code>-q</code>
845options.
846See the
847<code>tinker</code>
848configuration file directive for other options.
849Note: The kernel time discipline is disabled with this option.
850<div class="node">
851<p><hr>
852<a name="ntpd-usepcc"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-pccfreq">ntpd pccfreq</a>,
853Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-slew">ntpd slew</a>,
854Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
855<br>
856</div>
857
858<h4 class="subsection">usepcc option</h4>
859
860<p><a name="index-ntpd_002dusepcc-30"></a>
861This is the &ldquo;use cpu cycle counter (windows only)&rdquo; option.
862
863<p class="noindent">This option has some usage constraints.  It:
864     <ul>
865<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
866</ul>
867
868  <p>Attempt to substitute the CPU counter for <code>QueryPerformanceCounter</code>.
869The CPU counter and <code>QueryPerformanceCounter</code> are compared, and if
870they have the same frequency, the CPU counter (RDTSC on x86) is
871used directly, saving the overhead of a system call.
872<div class="node">
873<p><hr>
874<a name="ntpd-pccfreq"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-mdns">ntpd mdns</a>,
875Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-usepcc">ntpd usepcc</a>,
876Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
877<br>
878</div>
879
880<h4 class="subsection">pccfreq option</h4>
881
882<p><a name="index-ntpd_002dpccfreq-31"></a>
883This is the &ldquo;force cpu cycle counter use (windows only)&rdquo; option.
884This option takes a string argument.
885
886<p class="noindent">This option has some usage constraints.  It:
887     <ul>
888<li>must be compiled in by defining <code>SYS_WINNT</code> during the compilation.
889</ul>
890
891  <p>Force substitution the CPU counter for <code>QueryPerformanceCounter</code>.
892The CPU counter (RDTSC on x86) is used unconditionally with the
893given frequency (in Hz).
894<div class="node">
895<p><hr>
896<a name="ntpd-mdns"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-config">ntpd config</a>,
897Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-pccfreq">ntpd pccfreq</a>,
898Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
899<br>
900</div>
901
902<h4 class="subsection">mdns option (-m)</h4>
903
904<p><a name="index-ntpd_002dmdns-32"></a>
905This is the &ldquo;register with mdns as a ntp server&rdquo; option.
906
907<p class="noindent">This option has some usage constraints.  It:
908     <ul>
909<li>must be compiled in by defining <code>HAVE_DNSREGISTRATION</code> during the compilation.
910</ul>
911
912  <p>Registers as an NTP server with the local mDNS server which allows
913the server to be discovered via mDNS client lookup.
914
915<div class="node">
916<p><hr>
917<a name="ntpd-config"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-exit-status">ntpd exit status</a>,
918Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-mdns">ntpd mdns</a>,
919Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
920<br>
921</div>
922
923<h4 class="subsection">presetting/configuring ntpd</h4>
924
925<p>Any option that is not marked as <i>not presettable</i> may be preset by
926loading values from environment variables named <code>NTPD</code> and <code>NTPD_&lt;OPTION_NAME&gt;</code>.  <code>&lt;OPTION_NAME&gt;</code> must be one of
927the options listed above in upper case and segmented with underscores.
928The <code>NTPD</code> variable will be tokenized and parsed like
929the command line.  The remaining variables are tested for existence and their
930values are treated like option arguments.
931
932  <p>The command line options relating to configuration and/or usage help are:
933
934<h5 class="subsubheading">version (-)</h5>
935
936<p>Print the program version to standard out, optionally with licensing
937information, then exit 0.  The optional argument specifies how much licensing
938detail to provide.  The default is to print just the version.  The licensing infomation may be selected with an option argument.
939Only the first letter of the argument is examined:
940
941     <dl>
942<dt><span class="samp">version</span><dd>Only print the version.  This is the default.
943<br><dt><span class="samp">copyright</span><dd>Name the copyright usage licensing terms.
944<br><dt><span class="samp">verbose</span><dd>Print the full copyright usage licensing terms.
945</dl>
946
947<div class="node">
948<p><hr>
949<a name="ntpd-exit-status"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Usage">ntpd Usage</a>,
950Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-config">ntpd config</a>,
951Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
952<br>
953</div>
954
955<h4 class="subsection">ntpd exit status</h4>
956
957<p>One of the following exit values will be returned:
958     <dl>
959<dt><span class="samp">0 (EXIT_SUCCESS)</span><dd>Successful program execution.
960<br><dt><span class="samp">1 (EXIT_FAILURE)</span><dd>The operation failed or the command syntax was not valid.
961</dl>
962  <div class="node">
963<p><hr>
964<a name="ntpd-Usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Files">ntpd Files</a>,
965Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-exit-status">ntpd exit status</a>,
966Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
967<br>
968</div>
969
970<h4 class="subsection">ntpd Usage</h4>
971
972<div class="node">
973<p><hr>
974<a name="ntpd-Files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-See-Also">ntpd See Also</a>,
975Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Usage">ntpd Usage</a>,
976Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
977<br>
978</div>
979
980<h4 class="subsection">ntpd Files</h4>
981
982<div class="node">
983<p><hr>
984<a name="ntpd-See-Also"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Bugs">ntpd Bugs</a>,
985Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Files">ntpd Files</a>,
986Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
987<br>
988</div>
989
990<h4 class="subsection">ntpd See Also</h4>
991
992<div class="node">
993<p><hr>
994<a name="ntpd-Bugs"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ntpd-Notes">ntpd Notes</a>,
995Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-See-Also">ntpd See Also</a>,
996Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
997<br>
998</div>
999
1000<h4 class="subsection">ntpd Bugs</h4>
1001
1002<div class="node">
1003<p><hr>
1004<a name="ntpd-Notes"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ntpd-Bugs">ntpd Bugs</a>,
1005Up:&nbsp;<a rel="up" accesskey="u" href="#ntpd-Invocation">ntpd Invocation</a>
1006<br>
1007</div>
1008
1009<h4 class="subsection">ntpd Notes</h4>
1010
1011<div class="node">
1012<p><hr>
1013<a name="Usage"></a>
1014<br>
1015</div>
1016
1017<!-- node-name,  next,  previous,  up -->
1018<h3 class="section">Usage</h3>
1019
1020