How to config Time and date on CentOS 7 (NTP)

The Network Time Protocol (NTP) is a networking protocol for clock synchronization between computer systems over packet-switched, variable-latency data networks.

NTP time servers work within the TCP/IP suite and rely on User Datagram Protocol (UDP) port 123.

NTP servers are normally dedicated NTP devices that use a single time reference to which they can synchronize a network. … Dedicated NTP servers are required for Security, Protection, Accuracy, Legality, and Control.

NTP (Network Time Protocol) is a protocol which runs over port 123 UDP. NTP synchronize clients time and date with a master server.

Here in this tutorial the client side configuration is taken in to account where the server side configurations are not entirely different.

Here let us assume that you have root permission, otherwise, you may start commands with “sudo”.

Install and configure NTP Daemon

NTP package is provided by default from RHEL repositories, and can be installed by the following command:

yum install ntp

To make sure that the appropriate time zone is configured on the server please execute below command.

timedatectl

If you wish to change the timezone please follow following steps.

to get the list of all the available time zones:

timedatectl list-timezones

To set your time zone you can use command below: (e.g. Kolkata)

timedatectl set-timezone Asia/Kolkata

Now you need to active the NTPD service at boot:

systemctl enable ntpd
systemctl start ntpd

To get a basic report you can use

ntpstat

Or

date

And to get some information about the time synchronization process

ntpq -p

All of your NTP configurations are here:

/etc/ntp.conf

Please share you valuable comments to improve us better.

To flush the DNS Cache in Windows and Linux, click here