These sites are kind enough to perform this service for you, you should follow any guidelines they request (asking permission first, donations, thank-you notes, whatever.)
Let's suppose you've picked clock.example.org and timekeeper.sample.com. Those aren't real sites, but I'll use them as examples in the rest of this document.
Here's the command that does this:
ntpdate -b clock.example.org timekeeper.sample.com(NOTE: Substitute the 2 NTP servers that you'd like to sync with.)
Try this once from the command line (as "root") to make sure you're got it right.
# ntpdate -b clock.example.org timekeeper.sample.com 5 Jun 08:50:18 ntpdate[23777]: step time server 10.10.10.10 offset -111.106949 secThis means that your clock was off by -111.106949 seconds, but now it's been brought up to date. The good news is that for an instant you were in sync. The bad news is that by the time you read this, your clock has drifted. Darn computers!
Let's configure your system to run this command on boot up. Here's how to do this on various operating systems:
ntpdate_enable="YES" ntpdate_flags="-b clock.example.org timekeeper.sample.com"
The NTP documentation has volumes about the various features and entire books can be written about the theory of operation of NTP. It's really quite amazing how the system works so precisely, so accurately, does the right thing through outages, detects and avoids misconfigured servers, conserves bandwidth, and fixes problems that you don't yet realize you have. However, you don't care about that, you just want a simple configuration that works. Here's one:
Create a configuration file. Different systems call it different things.
Put these 3 lines in your configuration file:
driftfile /etc/ntp.drift server clock.example.org server timekeeper.sample.comNow start ntpd.
/usr/sbin/ntpd -p /var/run/ntpd.pid
/etc/rc2.d/S74xntpd start
Of course, you'll want to make sure that this command is run on bootup, after ntpdate is run (they can't run at the same time). Here's how to do that on various operating systems:
xntpd_enable="YES"Then use "touch" to create some initial files:
touch /etc/ntp.drift /var/log/ntpd.log
ntpdc -c peersHere's a sample run:
> ntpdc -c peers remote local st poll reach delay offset disp ======================================================================= =clock.example.o 5.0.0.0 16 64 0 0.00000 0.000000 0.00000 =timekeeper.samp 5.0.0.0 16 64 0 0.00000 0.000000 0.00000Output like that (all zeros) means that we haven't synced with those two servers yet.
When things get synced, the numbers will fill out like this:
> ntpdc -c peers remote local st poll reach delay offset disp ======================================================================= *clock.example.o 64.46.24.66 3 64 377 0.00018 0.000329 0.00255 =timekeeper.samp 61.26.45.88 3 64 377 0.00017 0.002122 0.00342
% ntpdc -c peers ntp-2.cso.uiuc.edu remote local st poll reach delay offset disp ======================================================================= +ntp-1.gw.uiuc.e 0.0.0.0 2 1024 172 0.00627 -0.000044 0.00761 +tick.usno.navy. 0.0.0.0 1 1024 373 0.09023 -0.023207 0.15714 *truechimer.cso. 0.0.0.0 1 1024 377 0.00401 -0.000054 0.00006 +ntp-0.gw.uiuc.e 0.0.0.0 2 512 332 0.01059 0.001216 0.00497
At my company, we have 2 NTP servers: ntp1.mycompany.com and ntp2.mycompany.com. Those are actually aliases ("CNAME" in DNS) that point to the 2 machine that I want everyone to use for NTP service. We do another trick that makes the aliases point to different hosts outside our firewall. That way the same configuration file works if a machine is connected inside or outside our firewall.
These 2 NTP servers need to have a custom configuration, that includes each other:
driftfile /etc/ntp.drift # public NTP servers we sync to: (use these 2 lines ONLY on ntp1 and ntp2!) server clock.example.org server timekeeper.sample.com # Use these lines on all machines in mycompany.com: server ntp1.mycompany.com server ntp2.mycompany.comI find that it is easier to have the exact same file on both of these servers. That means that ntp1 will try to sync with itself, and ntp2 will try to sync with itself. Luckily, this is ok. NTP will realize that its talking to itself and do the right thing (ignore itself).
All the other hosts have this ntp.conf:
driftfile /etc/ntp.drift # Use these lines on all machines in mycompany.com: server ntp1.mycompany.com server ntp2.mycompany.com
Galleon Systems - Time Synchronisation Specialist. Galleon provide NTP Servers for time synchronisation of computer networks.
I do, however, completely endorse this product for system administrators that want to be able to better manage their time:
O'Reilly's Time Management for System Administrators - NTP manages time for your computer. If YOU need help with HUMAN time management, this is the book for you!