1.\" $OpenBSD: ntpd.8,v 1.45 2019/11/11 17:42:28 otto Exp $ 2.\" 3.\" Copyright (c) 2003, 2004, 2006 Henning Brauer <henning@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN 14.\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 15.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: November 11 2019 $ 18.Dt NTPD 8 19.Os 20.Sh NAME 21.Nm ntpd 22.Nd Network Time Protocol daemon 23.Sh SYNOPSIS 24.Nm ntpd 25.Bk -words 26.Op Fl dnv 27.Op Fl f Ar file 28.Ek 29.Sh DESCRIPTION 30The 31.Nm 32daemon synchronizes the local clock to one or more remote NTP servers 33or local timedelta sensors. 34.Nm 35can also act as an NTP server itself, 36redistributing the local time. 37It implements the Simple Network Time Protocol version 4, 38as described in RFC 5905, 39and the Network Time Protocol version 3, 40as described in RFC 1305. 41Time can also be fetched from TLS HTTPS servers to reduce the 42impact of unauthenticated NTP 43man-in-the-middle attacks. 44.Pp 45The options are as follows: 46.Bl -tag -width "-f fileXXX" 47.It Fl d 48Do not daemonize. 49If this option is specified, 50.Nm 51will run in the foreground and log to 52.Em stderr . 53.It Fl f Ar file 54Use 55.Ar file 56as the configuration file, 57instead of the default 58.Pa /etc/ntpd.conf . 59.It Fl n 60Configtest mode. 61Only check the configuration file for validity. 62.Pp 63.Nm 64will stay in the foreground for up to 15 seconds waiting for one of the 65configured NTP servers to reply. 66.It Fl v 67This option allows 68.Nm 69to send DEBUG priority messages to syslog. 70.El 71.Pp 72.Nm 73uses the 74.Xr adjtime 2 75system call to correct the local system time without causing time jumps. 76Adjustments of 32ms and greater are logged using 77.Xr syslog 3 . 78The threshold value is chosen to avoid having local clock drift 79thrash the log files. 80Should 81.Nm 82be started with the 83.Fl d 84or 85.Fl v 86option, all calls to 87.Xr adjtime 2 88will be logged. 89.Pp 90.Nm 91makes efforts to verify and correct the time at boot if constraints are 92configured and satisfied or if trusted servers or sensors return results, 93and if the clock is not being moved backwards. 94.Pp 95After the local clock is synchronized, 96.Nm 97adjusts the clock frequency using the 98.Xr adjfreq 2 99system call to compensate for systematic drift. 100.Pp 101.Nm 102is started at boot time by default via 103.Va ntpd_flags 104in 105.Pa /etc/rc.conf . 106See 107.Xr rc 8 108and 109.Xr rc.conf 8 110for more information on the boot process 111and enabling daemons. 112.Pp 113When 114.Nm 115starts up, it reads settings from its configuration file, 116typically 117.Xr ntpd.conf 5 , 118and its initial clock drift from 119.Pa /var/db/ntpd.drift . 120Clock drift is periodically written to the drift file thereafter. 121.Sh FILES 122.Bl -tag -width "/var/db/ntpd.driftXXX" -compact 123.It Pa /etc/ntpd.conf 124Default configuration file. 125.It Pa /var/db/ntpd.drift 126Drift file. 127.It Pa /var/run/ntpd.sock 128Socket file for communication with 129.Xr ntpctl 8 . 130.El 131.Sh SEE ALSO 132.Xr date 1 , 133.Xr adjfreq 2 , 134.Xr adjtime 2 , 135.Xr ntpd.conf 5 , 136.Xr ntpctl 8 , 137.Xr rc 8 , 138.Xr rc.conf 8 , 139.Xr rdate 8 140.Sh STANDARDS 141.Rs 142.%A David L. Mills 143.%D March 1992 144.%R RFC 1305 145.%T Network Time Protocol (Version 3): Specification, Implementation and Analysis 146.Re 147.Pp 148.Rs 149.%A David L. Mills 150.%A Jim Martin 151.%A Jack Burbank 152.%A William Kasch 153.%D June 2010 154.%R RFC 5905 155.%T Network Time Protocol Version 4: Protocol and Algorithms Specification 156.Re 157.Sh HISTORY 158The 159.Nm 160program first appeared in 161.Ox 3.6 . 162