1.\" $OpenBSD: ntpd.8,v 1.40 2015/10/30 16:41:53 reyk 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: October 30 2015 $ 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 dnSsv 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.It Fl S 63Do not set the time immediately at startup. 64This is the default. 65.It Fl s 66Try to set the time immediately at startup, as opposed to slowly adjusting the 67clock. 68.Nm 69will stay in the foreground for up to 15 seconds waiting for one of the 70configured NTP servers to reply. 71.It Fl v 72This option allows 73.Nm 74to send DEBUG priority messages to syslog. 75.El 76.Pp 77.Nm 78uses the 79.Xr adjtime 2 80system call to correct the local system time without causing time jumps. 81Adjustments of 32ms and greater are logged using 82.Xr syslog 3 . 83The threshold value is chosen to avoid having local clock drift 84thrash the log files. 85Should 86.Nm 87be started with the 88.Fl d 89or 90.Fl v 91option, all calls to 92.Xr adjtime 2 93will be logged. 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 usually started at boot time, and can be enabled by 103setting 104.Va ntpd_flags 105in 106.Pa /etc/rc.conf.local . 107See 108.Xr rc 8 109and 110.Xr rc.conf 8 111for more information on the boot process 112and enabling daemons. 113.Pp 114When 115.Nm 116starts up, it reads settings from its configuration file, 117typically 118.Xr ntpd.conf 5 , 119and its initial clock drift from 120.Pa /var/db/ntpd.drift . 121Clock drift is periodically written to the drift file thereafter. 122.Sh FILES 123.Bl -tag -width "/var/db/ntpd.driftXXX" -compact 124.It Pa /etc/ntpd.conf 125Default configuration file. 126.It Pa /var/db/ntpd.drift 127Drift file. 128.It Pa /var/run/ntpd.sock 129Socket file for communication with 130.Xr ntpctl 8 . 131.El 132.Sh SEE ALSO 133.Xr date 1 , 134.Xr adjfreq 2 , 135.Xr adjtime 2 , 136.Xr ntpd.conf 5 , 137.Xr ntpctl 8 , 138.Xr rc 8 , 139.Xr rc.conf 8 , 140.Xr rdate 8 141.Sh STANDARDS 142.Rs 143.%A David L. Mills 144.%D March 1992 145.%R RFC 1305 146.%T Network Time Protocol (Version 3): Specification, Implementation and Analysis 147.Re 148.Pp 149.Rs 150.%A David L. Mills 151.%A Jim Martin 152.%A Jack Burbank 153.%A William Kasch 154.%D June 2010 155.%R RFC 5905 156.%T Network Time Protocol Version 4: Protocol and Algorithms Specification 157.Re 158.Sh HISTORY 159The 160.Nm 161program first appeared in 162.Ox 3.6 . 163