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
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop











{ 15 comments… read them below or add one }
Time is not updated through asia.pool.ntp.org. Any other server that can be configured in /etc/ntpd.conf. Please suggest
Goto -> http://www.pool.ntp.org/ and select the server you want :)
Iam unable to syn two systems time between redhat 7 and redhat enterprise 4.
Is there any please reply.
Works perfect! GNOME wouldn’t update the time itself, so I came here. Thanks, buddy!
its good but tell me how i sync the client with my ntp server
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
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.
us.pool.ntp.org
Use ntp1.funet.fi or ntp2.funet.fi
They work nicely :)
Hi, wanted to sync up my (SentOS)VM with NTP. Followed the above mentioned steps, but did not get the intended (described) results. Instead , I got the following errors :
[root@vm-perfads02 America]# /etc/init.d/ntpd start
Starting ntpd: <–Good ! No error !!
[root@vm-02 ~]# ntpdate pool.ntp.org
9 Mar 10:16:09 ntpdate[7372]: the NTP socket is in use, exiting
[root@vm-02 ~]# ntpdate pool.ntp.org
9 Mar 10:16:17 ntpdate[7375]: the NTP socket is in use, exiting
[root@vm-02 ~]# rdate -s aa.bb.cc.dd
rdate: couldn't connect to host aa.bb.cc.dd: No route to host
I ended up fixing the issue , by date command ( as below ):
[root@vm-perfads02 America]# date
Fri Mar 9 10:27:33 PST 2012 <–This date was incorrect
[root@vm-perfads02 etc]# date 030918402012
Fri Mar 9 18:40:00 PST 2012 <–This is correct date [same as other servers]
Also bounced the box to recheck if the above date sticks and it does ! Hence sharing this info and good news. Kindest regards,
ntpdate is not used anymore, now we have ntpd -q -g, as explained here: en.gentoo-wiki.com/wiki/NTP.
use ” ntpdate -u pool.ntp.org ”
If your server is behind firewall.
I’m facing the problem on time incorrect even I had sync it correctly with ntpd. Weird.
Comment by Sameed Worked for me.. here is my system output.
[root@server1~]# ntpdate
11 Mar 17:11:11 ntpdate[31328]: the NTP socket is in use, exiting
[root@server1~]# date
Mon Mar 11 17:11:17 CDT 2013
[root@server1~]# ntpdate -u
11 Mar 17:29:29 ntpdate[31551]: step time server offset 979.012426 sec
[root@server1~]# date
Mon Mar 11 17:29:35 CDT 2013
not sure.. why my command was truncated in my comments so re posting.. I used:
“ntpdate [our internal server ip]” – Failed
“ntpdate -u [our internal server ip]” – worked.