NTP on Unix

Network Time Protocol (NTP) on Unix/Linux Machines is used to synchronize the system clock with accurate standardized clocks for precise time keeping needed in communication, scientific research and finance.

In this basic NTP on Unix example we’ll be using xntpd – Network Time Protocol daemon on Solaris 10

To see the time and date set on your Unix system type:

sunbox% date

Wed Feb 22 14:13:31 PST 2012

sunbox%

To see if ntp is already running on your Unix system type:

sunbox% ps -ef | grep ntp

    root   243     1   0   Feb 20 ?           0:14 /usr/lib/inet/xntpd

The default configuration file for the xntp daemon is /etc/inet/ntp.conf

sunbox% more ntp.conf

# ident “@(#)ntp.client 1.3     00/07/17 SMI”

#

# /etc/inet/ntp.client

#

# An example file that could be copied over to /etc/inet/ntp.conf; it

# provides a configuration for a host that passively waits for a server

# to provide NTP packets on the ntp multicast net.

#

#multicastclient 224.0.1.1

server xxx.xxx.xxx.x

sunbox% nslookup xxx.xxx.xxx.x

Server:         xx.xx.x.x

Address:        xx.xx.x.x#53

Non-authoritative answer:

x.xxx.xxx.xxx.in-addr.arpa      name = time.time.timeserver???.com.

Authoritative answers can be found from:

xxx.xxx.xxx.in-addr.arpa        nameserver =

sunbox%

Many other settings are available in NTP to tweak the accuracy of the received time signal and to provide authentication of the time signal to enhance security. These are typically used in the banking and financial industries where accurate and authenticated transaction time stamps are critical. The “fudge” command in NTP can be used to take in account signal delays and cable lengths between the master clock and the NTP client.

Cable loss calculation errors can cause your time signal to be off causing significant errors in your data. Especially if you require timing precise enough to measure the velocity  of particles traveling at the speed of light. This happened recently at the particle accelerator CERN, prompting a friendly reminder from Forbes:  Always Check the Cable Before Doubting Einstein.

It is also possible to have NTP running on an Android or iOS powered smart phone which I’ll cover in another post.