Get Virtualizor
Configure CentOS to Sync with NTP Time Servers

Over the years, We’ve encountered many questions on how to correctly configure our Linux hosts to sync time to our enterprise NTP Servers.

So, We thought why not create an article that outlines in the simplest form possible the correct way to configure the NTP Client to synchronize with NTP Servers.

Sync CentOS with NTP Time Servers

First of all, we need to install the ntpd and ntpdate clients on our Linux host. I’m using CentOS, but it’s the same in Ubuntu and so forth.

# yum install ntp ntpdate
# systemctl start ntpd
# systemctl enable ntpd
# systemctl status ntpd

Now let’s run the following command to configure the NTP Servers.

# ntpdate -u -s 0.centos.pool.ntp.org 1.centos.pool.ntp.org 2.centos.pool.ntp.org

What we’re doing is telling the ntpdate to use an unprivileged port for outgoing packets with the -u switch and to write logging output to the system syslog facility using the -s switch.

Next let’s restart the ntpd daemon.

# systemctl restart ntpd

Now let’s check if NTP synchronization is enabled and running.

# timedatectl

And for the last, we will set the hardware clock to the current system time using the -w switch.

# hwclock -w

Congratulations! You’ve now successfully set your NTP client on CentOS.

Newsletter Subscription
Subscribing you to the mailing list