RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Stay time synchronized with Internet Time server and ntpd

If you wish to synchronize your system time with a world time servers all you need to do is to install a ntpdate utility and issue a following command as a root user and you are done:

# ntpdate pool.ntp.org

The above command will synchronize your system time / clock. However, if you want to stay synchronized you need to do little bit more work. The work involves installation and configuration of NTPD daemon. NTPD uses NTP ( network time protocol ) to access a specified time server over the internet. Later, it will keep your system time synchronized without your further intervention.

First we need to install NTPD service. On Debian or Ubuntu this step is easy as:

# apt-get install ntp

In most cases your NTP Daemon will be configured out of the box and installation of ntp package is all you would ever need to do to keep your system time synchronized with internet standard time servers. However, it is good to check certain settings whether they are in place before we leave a system time in hands of NTP daemon. The absolute bare configuration is:

driftfile - this file is used by a ntp daemon to store a clock drift / synchronization error


driftfile /var/lib/ntp/ntp.drift

The second must is a fully qualified domain name of a time server which we intend to use for a time synchronization. On Ubuntu or Debian You may see default settings like:

server 0.debian.pool.ntp.org iburst
server 1.debian.pool.ntp.org iburst
server 2.debian.pool.ntp.org iburst
server 3.debian.pool.ntp.org iburst

at this point your are done with installation and configuration of NTPD daemon. All what left is to start / restart ntpd:

# /etc/init.d/ntp restart
Stopping NTP server: ntpd.
Starting NTP server: ntpd.

Next check whether your ntpd is functioning by listing of time server peers your connected to:

# ntpq  -p

OUTPUT:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+morose.quex.org 128.118.25.5     2 u   56   64  377  312.518    6.665   1.926
+conquest.kjsl.c 69.36.224.15     2 u   51   64  377  242.611   13.283   1.001
*clock-a.develoo 164.67.62.212    2 u   46   64  377  223.659   11.650  12.113
-kiri.nonexiste. 173.9.142.98     3 u   24   64  377  290.828   -8.391   7.969

or if you wish to view a external server IP address instead of host info:

# ntpq  -pn

OUTPUT:

     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+206.222.28.90   128.118.25.5     2 u   24   64  377  312.518    6.665   0.426
+198.137.202.16  69.36.224.15     2 u   18   64  377  241.980   14.347   1.365
*207.171.7.151   164.67.62.212    2 u   10   64  377  250.055   -1.022   0.764
-173.45.238.221  173.9.142.98     3 u   57   64  377  290.828   -8.391   7.969

Share this linux post:

Submit Stay time synchronized with Internet Time server and ntpd in Delicious Submit Stay time synchronized with Internet Time server and ntpd in Digg Submit Stay time synchronized with Internet Time server and ntpd in FaceBook Submit Stay time synchronized with Internet Time server and ntpd in Google Bookmarks Submit Stay time synchronized with Internet Time server and ntpd in Stumbleupon Submit Stay time synchronized with Internet Time server and ntpd in Technorati Submit Stay time synchronized with Internet Time server and ntpd in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download