About FreeBSD

Synchronise the system clock

Synchronise the system clock of a FreeBSD server to the timeservers of the NTP Pool Project. The FreeBSD server uses ntpd(8) to continuously adjust its system clock to maintain synchronisation with the remote timeservers. The NTP Pool Project coordinates a large cluster of timeservers provided by volunteers.

Configuration

Choose the timeserver pool closest to the FreeBSD server, then create a /etc/ntp.conf file listing the names of the timeservers in the pool. For example, for a FreeBSD server in the United Kingdom, /etc/ntp.conf should contain:

server 0.uk.pool.ntp.org
server 1.uk.pool.ntp.org
server 2.uk.pool.ntp.org
server 3.uk.pool.ntp.org

The NTP daemon is started at boot time by adding the following line to /etc/rc.conf:

ntpd_enable="YES"

The service can also be started manually by using:

# service ntpd start
If the FreeBSD server’s system clock is more than 1000s off, ntpd(8) will exit with an error message written to the system logfile. This can be caused by using local time without configuring the correct time zone.

Other Useful Commands

a(d)te(1)

1date]Is used to set the system time.

o(t)p(1)

1top]Can be used to monitor the clock in real time.

a(t)il(1)

1tail] Can be used to monitor system messages in real time with:

tail -F /var/log/messages

Further Reading