9 .Nd set the date and time via NTP
22 The functionality of this program is now available
32 After a suitable period of
35 utility is to be retired from this
40 utility sets the local date and time by polling the
41 Network Time Protocol (NTP) server(s) given as the
43 arguments to determine the correct time.
44 It must be run as root on
46 A number of samples are obtained from each of the
47 servers specified and a subset of the NTP clock filter and
48 selection algorithms are applied to select the best of these.
50 that the accuracy and reliability of
53 the number of servers, the number of polls each time it is run and
54 the interval between runs.
56 The following options are available:
57 .Bl -tag -width indent
59 Force DNS resolution of following host names on the command line to the
62 Force DNS resolution of following host names on the command line to the
65 Enable the authentication function and specify the key
66 identifier to be used for authentication as the argument
68 The keys and key identifiers must match
69 in both the client and server key files.
70 The default is to disable
71 the authentication function.
73 Force the time to always be slewed using the
76 call, even if the measured offset is greater than +-128 ms.
78 default is to step the time using
81 greater than +-128 ms.
82 Note that, if the offset is much greater
83 than +-128 ms in this case, it can take a long time (hours) to
84 slew the clock to the correct value.
85 During this time, the host
86 should not be used to synchronize clients.
88 Force the time to be stepped using the
91 call, rather than slewed (default) using the
94 This option should be used when called from a startup file at boot
97 Enable the debugging mode, in which
100 through all the steps, but not adjust the local clock.
102 useful for general debugging will also be printed.
103 .It Fl e Ar authdelay
104 Specify the processing delay to perform an authentication
105 function as the value
107 in seconds and fraction
111 This number is usually small
112 enough to be negligible for most purposes, though specifying a
113 value may improve timekeeping on very slow CPU's.
115 Specify the path for the authentication key file as the string
120 should be in the format described in
123 Specify the NTP version for outgoing packets as the integer
129 to be used with older NTP versions.
131 Specify the number of samples to be acquired from each server
134 with values from 1 to 8 inclusive.
137 Query only - do not set the clock.
139 Divert logging output from the standard output (default) to the
143 This is designed primarily for
148 Specify the maximum time waiting for a server response as the
151 in seconds and fraction.
153 rounded to a multiple of 0.2 seconds.
154 The default is 1 second, a
155 value suitable for polling across a LAN.
159 to use an unprivileged port for outgoing
161 This is most useful when behind a firewall that blocks
162 incoming traffic to privileged ports, and you want to synchronise
163 with hosts beyond the firewall.
167 always uses unprivileged ports.
170 This option will cause
173 identification string to be logged.
178 utility can be run manually as necessary to set the
179 host clock, or it can be run from the host startup script to set
180 the clock at boot time.
181 This is useful in some cases to set the
182 clock initially before starting the NTP daemon
190 However, it is important to note that
195 scripts is no substitute for the NTP
196 daemon, which uses sophisticated algorithms to maximize accuracy
197 and reliability while minimizing resource use.
200 does not discipline the host clock frequency as
208 Time adjustments are made by
214 determines the clock is in error more
215 than 0.5 second it will simply step the time by calling the system
218 If the error is less than 0.5
219 seconds, it will slew the time by calling the system
222 The latter technique is less disruptive
223 and more accurate when the error is small, and works quite well
233 utility will decline to set the date if an NTP server
236 is running on the same host.
240 on a regular basis from
243 an alternative to running a daemon, doing so once every hour or two
244 will result in precise enough timekeeping to avoid stepping the
247 Note that in contexts where a host name is expected, a
249 qualifier preceding the host name forces DNS resolution to the
250 IPv4 namespace, while a
252 qualifier forces DNS resolution to the IPv6 namespace.
254 If NetInfo support is compiled into
258 argument is optional if
261 time server in the NetInfo configuration for
264 .Bl -tag -width /etc/ntp.keys -compact
266 contains the encryption keys used by
272 The slew adjustment is actually 50% larger than the measured
273 offset, since this (it is argued) will tend to keep a badly
274 drifting clock more accurate.
275 This is probably not a good idea and
276 may cause a troubling hunt for some values of the kernel variables
277 .Va kern.clockrate.tick
279 .Va kern.clockrate.tickadj .