Configure a system to use NTP

Author: Grzegorz Czapliński gregory at systemics dot pl FreeBSD

Reviewer: Cezary Morga FreeBSD

Reviewer: name contact BSD flavour


Be familiar with the concepts in RFC 868, the importance of synchronizing time(((time, network))) on server systems and which services in particular are time sensitive. Be able to configure NTP and manually synchronize with a time server as required.


TODO: following are some contributed notes. Some can be removed as refer to too advanced. Also may be FreeBSD-specific.

ntpd: Network time protocol (NTP) daemon

ntp.conf: NTP daemon configuration file (/etc/ntp.conf). OpenBSD uses /etc/ntpd.conf

ntpdc: special NTP query program

ntpq: standard NTP query program

ntpdate: set the date and time via NTP


/etc/ntp.conf default name of the configuration file

/etc/ntp.drift default name of the drift file

/etc/ntp.keys default name of the key file

/usr/local/etc/ntp.keys private md5 keys

/ntpkey RSA private key

/ntpkey_host RSA public key

ntp_dh Diffie-Hellman agreement parameters

which services are time sensitive:

configuring NTP:


""server iburst prefer ""server iburst ""server iburst

(TODO: use generic example host names or use pool.)

""driftfile /var/db/ntp.drift ""restrict mask nomodify notrap

To start ntpd the first time without rebooting:

""ntpd -p /var/run/

After already started:

""/etc/rc.d/ntpd [start | stop | restart | etc...]

Manually synchronize NTP:

""ntpd -q

TODO: be sure to document for different implementations


Practice Exercises

More information

ntpd(8), ntp.conf(5) or ntpd.conf(5), rc.conf(5), rdate(8)