Network Time Protocol:

Keeping track of time on your server can become a bit daunting, when you start having multiple number of servers. A solution is called ntp (network time protocol). The machine ever so often, loses time, by going out up to a few hours. Defined period checks with a main time server, and adjusts your machines time if it is out from the main timeserver.


The following commands below will install and configure ntp under CentOS.

# yum install ntp
# chkconfig ntpd on
# ntpdate
# /etc/rc.d/init.d/ntpd restart

The results will be shown as below.

Shutting down ntpd:    [ OK ]
Starting ntpd:              [ OK ]


The following commands below will install and configure ntp under Ubuntu.

# apt-get install ntp

# /etc/init.d/ntp restart

Configuring the ntp.conf files will not be needed as they are automatically configured during installation.


Another way around this issue is to manually have the ntpdate application run directly via the cron to update the time. This issue is caused on virtual machines where the virtual software forces the virtual machine to sync with the host machine. Below is a work around. Just enter this into cron. The ip of the time server is

# crontab -e

*/5 * * * * /sbin/ntpdate -u

5 thoughts on “Network Time Protocol:”

  1. Hey Website Owner! I really like your blog, I found you on Google so I figure I’ll share this tip with you. There is a WordPress SEO plugin that does automatic Search optimization for your website, automated SEO add-ons like this one are new in the blogging arena so hopping on this now would give your page a huge traffic boost for sure. If you are serious about making your blog get bigger and make money then check it out @ Thanks, keep up the good work.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.