Reference

ntpd(8)

Network Time Protocol (NTP) daemon

NAME

ntpd – Network Time Protocol (NTP) daemon

SYNOPSIS

ntpd [-dnv] [-f file] [-p file]

DESCRIPTION

The ntpd daemon synchronizes the local clock to one or more remote NTP servers or local timedelta sensors. ntpd can also act as an NTP server itself, redistributing the local time. It implements the Simple Network Time Protocol version 4, as described in RFC 5905, and the Network Time Protocol version 3, as described in RFC 1305. Time can also be fetched from TLS HTTPS servers to reduce the impact of unauthenticated NTP man-in-the-middle attacks.

The options are as follows:

-d

Do not daemonize. If this option is specified, ntpd will run in the foreground and log to stderr.

-f file

Use file as the configuration file, instead of the default /etc/ntpd.conf.

-n

Configtest mode. Only check the configuration file for validity.

-v

This option allows ntpd to send DEBUG priority messages to syslog.

-p file

Write pid to file

ntpd uses the adjtime(2) system call to correct the local system time without causing time jumps. Adjustments of 32ms and greater are logged using syslog(3). The threshold value is chosen to avoid having local clock drift thrash the log files. Should ntpd be started with the -d or -v option, all calls to adjtime(2) will be logged.

At boot, ntpd will stay for a maximum of 15 seconds in the foreground and make efforts to verify and correct the time if constraints are configured and satisfied or if trusted servers or sensors return results, and if the clock is not being moved backwards.

After the local clock is synchronized, ntpd adjusts the clock frequency using the adjfreq(2) system call to compensate for systematic drift.

ntpd is started at boot time by default via ntpd_flags in /etc/rc.conf. See rc(8) and rc.conf(8) for more information on the boot process and enabling daemons.

When ntpd starts up, it reads settings from its configuration file, typically ntpd.conf(5), and its initial clock drift from /var/ntpd.drift. Clock drift is periodically written to the drift file thereafter.

FILES

/etc/ntpd.conf

Default configuration file.

/var/ntpd.drift

Drift file.

/var/run/ntpd.sock

Socket file for communication with ntpctl(8).

SEE ALSO

date(1), adjfreq(2), adjtime(2), ntpd.conf(5), ntpctl(8), rc(8), rc.conf(8), rdate(8)

STANDARDS

David L. Mills, Network Time Protocol (Version 3): Specification, Implementation and Analysis, RFC 1305, March 1992.

David L. Mills, Jim Martin, Jack Burbank, and William Kasch, Network Time Protocol Version 4: Protocol and Algorithms Specification, RFC 5905, June 2010.

HISTORY

The ntpd program first appeared in OpenBSD 3.6.

History

-d since Debian 10 (Buster); -n since Debian 6.0 (Squeeze); -p since Debian 6.0 (Squeeze); -v since Debian 13 (Trixie).

-! until Debian 11 (Bullseye); --assert until Debian 12 (Bookworm); --authnoreq until Debian 11 (Bullseye); --authreq until Debian 11 (Bullseye); --bcastsync until Debian 11 (Bullseye); --configfile until Debian 12 (Bookworm); --debug-level until Debian 12 (Bookworm); --driftfile until Debian 12 (Bookworm); --dvar until Debian 12 (Bookworm); --force-step-once until Debian 11 (Bullseye); --help until Debian 12 (Bookworm); --interface until Debian 12 (Bookworm); --ipv4 until Debian 12 (Bookworm); --ipv6 until Debian 12 (Bookworm); --jaildir until Debian 12 (Bookworm); --keyfile until Debian 12 (Bookworm); --logfile until Debian 12 (Bookworm); --mdns until Debian 12 (Bookworm); --modifymmtimer until Debian 11 (Bullseye); --more-help until Debian 11 (Bullseye); --nice until Debian 12 (Bookworm); --nofork until Debian 12 (Bookworm); --novirtualips until Debian 12 (Bookworm); --panicgate until Debian 12 (Bookworm); --pccfreq until Debian 11 (Bullseye); --pidfile until Debian 12 (Bookworm); --priority until Debian 12 (Bookworm); --propagationdelay until Debian 11 (Bullseye); --quit until Debian 12 (Bookworm); --saveconfigquit until Debian 11 (Bullseye); --set-debug-level until Debian 12 (Bookworm); --slew until Debian 12 (Bookworm); --statsdir until Debian 12 (Bookworm); --trustedkey until Debian 12 (Bookworm); --updateinterval until Debian 12 (Bookworm); --usepcc until Debian 11 (Bullseye); --user until Debian 12 (Bookworm); --var until Debian 12 (Bookworm); --version until Debian 12 (Bookworm); --wait-sync until Debian 12 (Bookworm); -4 until Debian 12 (Bookworm); -6 until Debian 12 (Bookworm); -? until Debian 11 (Bullseye); -A until Debian 11 (Bullseye); -D until Debian 12 (Bookworm); -G until Debian 12 (Bookworm); -I until Debian 12 (Bookworm); -L until Debian 12 (Bookworm); -M until Debian 11 (Bullseye); -N until Debian 12 (Bookworm); -P until Debian 12 (Bookworm); -S until Debian 13 (Trixie); -U until Debian 12 (Bookworm); -V until Debian 12 (Bookworm); -Z until Debian 12 (Bookworm); -a until Debian 12 (Bookworm); -b until Debian 11 (Bullseye); -c until Debian 12 (Bookworm); -g until Debian 12 (Bookworm); -h until Debian 12 (Bookworm); -i until Debian 12 (Bookworm); -k until Debian 12 (Bookworm); -l until Debian 12 (Bookworm); -m until Debian 12 (Bookworm); -q until Debian 12 (Bookworm); -r until Debian 11 (Bullseye); -s until Debian 13 (Trixie); -t until Debian 12 (Bookworm); -u until Debian 12 (Bookworm); -w until Debian 12 (Bookworm); -x until Debian 12 (Bookworm); -z until Debian 12 (Bookworm).