Time
Time Synchronization

Tired of your computer or server clock drifting? Would you like your computer's clock to be updated with the time from the NIST Internet Time Service in Boulder, Colorado? Here is how you do it!

WinNT/2000/WinMe/Win98
The quick and dirty way to do it is to download the free program Atomic Clock. It will check the NIST server periodically, and adjust it if your clock is over 15 seconds off. You can download the program here: Atomic.zip. After it has downloaded, just extract it to a temporary folder, and double click on atomic.exe. Once it is installed, just double click on Atomic Clock Sync on your desktop!

If you would like to be a more accurate than 15 seconds, do the following:
Download this file: Nistime.zip. After it has downloaded, use the following instructions:

  1. Extract Nistime to c: (it will extract inside it's own folder)
  2. Go there, double click on nistime-32bit.exe
  3. Select File>>Select Server
  4. Select utcnist.colorado.edu (Colorado) Then click OK
  5. Then go to File Save Config
  6. In the folder Nistime, there is a file called time.bat (or just time, if you have View Extensions off), go to Scheduled Tasks and add time.bat to run daily. If you aren't on an "always on" connection, you can just double click time.bat to update you clock when you are online.

Macintosh
Instructions that will work for OS 8 and above can be found here:
MacNistTime.pdf

Linux
First you will need to su to root access. Then:

  1. change directory to the cron.daily directory by typing:
    cd /etc/cron.daily
  2. Open a new file called ntp-time-synchronize by typing:
    vi ntp-time-synchronize
  3. In this file, you will need to make it look exactly as typed below:
    #!/bin/sh
    /usr/sbin/ntpdate 128.138.140.44

  4. Save it by typing:
    :wq
  5. You will need to make it executable by typing:
    chmod 700 ntp-time-synchronize
Your computer will now run this script every day and should ensure that your computer time is synchronized with the time servers.
If you have Red Hat 7.2 and up, then you have a datetime tool like Macs (above).

FreeBSD
Basic Configuration
If you only wish to synchronize your clock when the machine boots up, you can use ntpdate. This may be appropriate for some desktop machines which are frequently rebooted and only require infrequent synchronization, but most machines should run ntpd. Using ntpdate at boot time is also a good idea for machines that run ntpd. Ntpd changes the clock gradually, whereas ntpdate sets the clock, no matter how great the difference between a machines current clock setting and the correct time.

To enable ntpdate at boot time
First you will need to su to root access. Then:

  1. change directory to the etc directory by typing:
    cd etc
  2. Open the rc.conf file by typing:
    vi rc.conf
  3. Add the following lines at the end of the file:
    ntpdate_enable="YES"
    ntpdate_flags="128.138.140.44"
  4. Save it by typing:
    :wq
Now, every time your computer boots, it will retrieve the correct time from the NIST Server in Colorado.

To run ntpd so your computer will stay synchronized between reboots, do the following:
su to root access. Then:
  1. change directory to the etc directory by typing:
    cd etc
  2. Open a new file called ntp.conf by typing:
    vi ntp.conf
  3. Type in the following 2 lines:
    server 128.138.140.44
    driftfile="etc/ntp.drift"
  4. Save the file by typing:
    :wq

The driftfile option specifies which file is used to store the system clock's frequency offset. ntpd uses this to automatically compensate for the clocks natural drift, allowing it to maintain a reasonably correct setting even if it is cut off from all external time sources for a period of time. Ntpd will create it.

To have ntpd start at boot time, do the following:
  1. change directory to the etc directory by typing:
    cd etc
  2. Open the rc.conf file by typing:
    vi rc.conf
  3. Add the following lines at the end of the file:
    ntpd_enable="YES"
  4. Save it by typing:
    :wq


There you have it! Time synchronization in a nutshell!