Finding the right time with Openntpd

openntpd logo

OpenNTPd:

In the past, the built-in ntpd server in Freebsd served me well.  Since ntpd binds to all addresses on port 123, ntpd complained incessantly in jailed environments because jails expect to have exclusive access to the jail address.  Although it did not cause my server or jails to crash, it’s always better to be safe than sorry and fix the problem now rather than wait for a problem to manifest itself.

In search for a solution, openntpd can be utilized without binding to any address or addresses.  This makes it attractive for jailed environments.

 

Install openntpd:

# portsnap fetch update
# cd /usr/ports/net/openntpd
# make install clean

 

ntpd.conf:

Let’s take a look ntpd.conf file located in /usr/local/etc/ntpd.conf:

# sample ntpd configuration file, see ntpd.conf(5)
# Addresses to listen on (ntpd does not listen by default)
  listen on 192.168.0.220

# sync to a single server
# server ntp.example.org

# use a random selection of NTP Pool Time Servers
# see http://support.ntp.org/bin/view/Servers/NTPPoolServers
  servers pool.ntp.org

 

rc.conf:

To enable the openntpd daemon on startup, include the following statement in your rc.conf:

# ntpd_enable="NO"
# openntpd_enable="YES"
# openntpd_flags="-sv"

Note: the “-s” argument tells the daemon to immediately set the time if the clock is off by more than 180 seconds.

 

Summary:

Typically, the pool.ntp.org servers are chosen since the NTP Pool DNS system automatically picks the time servers geographically closet to you.  However, you can explicitly choose continental pools such as north-america.pool.ntp.org.

 

Additional References:

For additional information please view the following url:

http://support.ntp.org/bin/view/Servers/NTPPoolServers

http://www.openntpd.org

https://calomel.org/ntpd.html

Leave a Reply

Your email address will not be published. Required fields are marked *