7 .Nd set the date and time via NTP
20 The functionality of this program is now available
30 After a suitable period of
33 utility is to be retired from this
38 utility sets the local date and time by polling the
39 Network Time Protocol (NTP) server(s) given as the
41 arguments to determine the correct time.
42 It must be run as root on
44 A number of samples are obtained from each of the
45 servers specified and a subset of the NTP clock filter and
46 selection algorithms are applied to select the best of these.
48 that the accuracy and reliability of
51 the number of servers, the number of polls each time it is run and
52 the interval between runs.
54 The following options are available:
55 .Bl -tag -width indent
57 Force DNS resolution of following host names on the command line to the
60 Force DNS resolution of following host names on the command line to the
63 Enable the authentication function and specify the key
64 identifier to be used for authentication as the argument
66 The keys and key identifiers must match
67 in both the client and server key files.
68 The default is to disable
69 the authentication function.
71 Force the time to always be slewed using the
74 call, even if the measured offset is greater than +-128 ms.
76 default is to step the time using
79 greater than +-128 ms.
80 Note that, if the offset is much greater
81 than +-128 ms in this case, it can take a long time (hours) to
82 slew the clock to the correct value.
83 During this time, the host
84 should not be used to synchronize clients.
86 Force the time to be stepped using the
89 call, rather than slewed (default) using the
92 This option should be used when called from a startup file at boot
95 Enable the debugging mode, in which
98 through all the steps, but not adjust the local clock.
100 useful for general debugging will also be printed.
101 .It Fl e Ar authdelay
102 Specify the processing delay to perform an authentication
103 function as the value
105 in seconds and fraction
109 This number is usually small
110 enough to be negligible for most purposes, though specifying a
111 value may improve timekeeping on very slow CPU's.
113 Specify the path for the authentication key file as the string
118 should be in the format described in
121 Specify the NTP version for outgoing packets as the integer
127 to be used with older NTP versions.
129 Specify the number of samples to be acquired from each server
132 with values from 1 to 8 inclusive.
135 Query only - do not set the clock.
137 Divert logging output from the standard output (default) to the
141 This is designed primarily for
146 Specify the maximum time waiting for a server response as the
149 in seconds and fraction.
151 rounded to a multiple of 0.2 seconds.
152 The default is 1 second, a
153 value suitable for polling across a LAN.
157 to use an unprivileged port for outgoing
159 This is most useful when behind a firewall that blocks
160 incoming traffic to privileged ports, and you want to synchronise
161 with hosts beyond the firewall.
165 always uses unprivileged ports.
168 This option will cause
171 identification string to be logged.
176 utility can be run manually as necessary to set the
177 host clock, or it can be run from the host startup script to set
178 the clock at boot time.
179 This is useful in some cases to set the
180 clock initially before starting the NTP daemon
188 However, it is important to note that
193 scripts is no substitute for the NTP
194 daemon, which uses sophisticated algorithms to maximize accuracy
195 and reliability while minimizing resource use.
198 does not discipline the host clock frequency as
206 Time adjustments are made by
212 determines the clock is in error more
213 than 0.5 second it will simply step the time by calling the system
216 If the error is less than 0.5
217 seconds, it will slew the time by calling the system
220 The latter technique is less disruptive
221 and more accurate when the error is small, and works quite well
231 utility will decline to set the date if an NTP server
234 is running on the same host.
238 on a regular basis from
241 an alternative to running a daemon, doing so once every hour or two
242 will result in precise enough timekeeping to avoid stepping the
245 Note that in contexts where a host name is expected, a
247 qualifier preceding the host name forces DNS resolution to the
248 IPv4 namespace, while a
250 qualifier forces DNS resolution to the IPv6 namespace.
252 If NetInfo support is compiled into
256 argument is optional if
259 time server in the NetInfo configuration for
262 .Bl -tag -width /etc/ntp.keys -compact
264 contains the encryption keys used by
270 The slew adjustment is actually 50% larger than the measured
271 offset, since this (it is argued) will tend to keep a badly
272 drifting clock more accurate.
273 This is probably not a good idea and
274 may cause a troubling hunt for some values of the kernel variables
275 .Va kern.clockrate.tick
277 .Va kern.clockrate.tickadj .