NTP synchronization of the system clock

Update: I realised that the recipe below will not necessarily ensure the NTP service is started on booting and in the process of fixing that, I discovered that Yast actually has a nice GUI for setting up NTP. So, instead of step 2 and 3 below, open up Yast and go to Network Services > NTP Client, add the servers found in step 1 and be sure to select “During boot” under “Automatically start NTP daemon”. Next click Finish and you are done!

It takes just 5 minutes to set up your OpenSUSE box up to synchronize its clock with internet time servers, ensuring that you never have to manually adjust the time again. Internet time servers use a protocol aptly named Network Time Protocol (NTP). In a default installation of OpenSUSE you should already have the software needed to communicate with NTP servers. You can check this by issuing the following command as root in a console:

rpm -q xntp

If installed, you should see the version number printed. If not, install the package using YAST2 or use this command (on OpenSUSE 10.2):

zypper install xntp

Step 1 – finding appropriate time servers

You ISP may provide a time server for you to use. This should give you the most accurate synchronization, as the time server should be close to you in terms of network distance. If your ISP does not provide a time server, you can use the pool of servers offered by the pool.ntp.org project. They maintain a list of public time servers and use DNS to distribute the load among the servers. To find the time servers appropriate for you, go to their main page og select the region you are in from the list on the right. Next, see if you can find your own country listed. You should end up with a list of servers something like this:

server 1.dk.pool.ntp.org
server 1.europe.pool.ntp.org
server 2.europe.pool.ntp.org

Step 2 – setting up the NTP daemon

As root, open /etc/ntp.conf in your favourite editor and paste the server list found above into the file under the section labelled “Outside source of time synchronization”. Save the file.

Step 3 – restarting NTP

Next, still as root, run the command:

service ntp restart

If your clock was out of sync, you should see it change. From now on, the NTP daemon will periodically contact the time servers and adjust your system clock so it is always accurate.

  • Print
  • email
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • Google Buzz
  • Posterous
This entry was posted in Configuration. Bookmark the permalink.

Leave a Reply

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