Synchronize the system clock to Network Time Protocol (NTP) under Fedora or Red Hat Linux

by nixcraft on May 5, 2006 · 9 comments

The Network Time Protocol daemon (ntpd) program is a Linux operating system daemon. It sets and maintains the system time of day in synchronism with time servers (Mills).

You need to configure ntpd via /etc/ntp.conf configuration file. The file is well documented and you easily configure it.

Install ntpd

If ntpd is not installed use any one of the following command to install ntpd:
# yum install ntpOR# up2date ntp

Configuration

You should at least set following parameter in /etc/ntp.conf config file:
server <Time Server Name or IP Address>

For example, open /etc/ntp.conf file using vi text editor:
# vi /etc/ntp.conf
Locate server parameter and set it as follows:
server pool.ntp.org

Save the file and restart the ntpd service:
# /etc/init.d/ntpd start

You can synchronize the system clock to an NTP server immediately with following command:
# ntpdate pool.ntp.org
Output:

 5 May 14:36:01 ntpdate[5257]: adjust time server 61.206.115.3 offset -0.343242 sec

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

We're here to help you make the most of sysadmin work. So, subscribe!

{ 9 comments… read them below or add one }

1 cool mind July 13, 2006

Time is not updated through asia.pool.ntp.org. Any other server that can be configured in /etc/ntpd.conf. Please suggest

Reply

2 nixcraft July 13, 2006

Goto -> http://www.pool.ntp.org/ and select the server you want :)

Reply

3 yellanna October 11, 2007

Iam unable to syn two systems time between redhat 7 and redhat enterprise 4.
Is there any please reply.

Reply

4 Timothy March 17, 2009

Works perfect! GNOME wouldn’t update the time itself, so I came here. Thanks, buddy!

Reply

5 ksk May 27, 2009

its good but tell me how i sync the client with my ntp server

Reply

6 Gururaj April 21, 2010

Hi ,
I am getting message as NTP socket in use , exiting … I am getting this message after I started the ntp service .

Do you know what it is ? any solution ?

Gururaj

Reply

7 DrCyb May 3, 2010

I had the same problem with Gururaj, until I found out that I need to stop the NTP service first.
/etc/init.d/ntpd stop
Then only ntpdate pool.ntp.org will work.

Why is this so when the instruction says to “Save the file and restart the ntpd service” then
“You can synchronize the system clock to an NTP server immediately with following command:” ?

The instructions doesn’t work in that order.

Reply

8 Sujith June 22, 2010

us.pool.ntp.org

Reply

9 Ville July 23, 2011

Use ntp1.funet.fi or ntp2.funet.fi
They work nicely :)

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 12 + 7 ?
Please leave these two fields as-is:
Are you a human being? Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: