Linux Network Time Protocol Setup

We can also synchronize the system clock with a remote server over the Network Time Protocol ( NTP).

For the one-time synchronization only, use the ntpdate command:

Check whether the selected NTP server is accessible:

[root@fedora ~]# ntpdate -q 0.rhel.pool.ntp.org
server 202.71.136.67, stratum 2, offset 0.014709, delay 0.25420
server 119.226.101.130, stratum 2, offset -0.007991, delay 0.21991
3 Oct 09:40:35 ntpdate[4083]: adjust time server 119.226.101.130 offset -0.007991 sec
[root@fedora ~]#

Run the ntpdate command followed by one or more server addresses:

[root@fedora ~]# ntpdate 0.rhel.pool.ntp.org 1.rhel.pool.ntp.org
3 Oct 09:41:36 ntpdate[4092]: adjust time server 119.226.101.131 offset 0.000724 sec

Enable the service.

[root@fedora ~]# systemctl status ntpd.service
ntpd.service - Network Time Service
Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled)
Active: inactive (dead) since Wed, 03 Oct 2012 09:42:42 +0530; 36s ago
CGroup: name=systemd:/system/ntpd.service

Oct 03 09:42:42 fedora.example.com ntpd[4105]: ntpd 4.2.6p5@1.2349-o Fri Apr 27 08:37:16 UTC 2012 (1)

Comments are closed.