NTP in Linux

MD Aminul Islam Sep 11, 2022
NTP in Linux

The NTP is a core protocol that is used by most of the IT infrastructure. The purpose of using it is to synchronize the date and time information.

But it’s very important to configure the NTP for your server, client, and other networking device. The NTP uses the UDP port number, which is by default 123.

In this article, we will illustrate the use of NTP, and also we will see a sample execution of the command with the necessary explanation to make the topic easier.

Network Time Protocol NTP in Linux

Below shared an example where we illustrated the use of the command NTP in Linux. The command will be as follows:

systemctl status ntp

We printed a list of NTP services status through the above command.

After executing the above command, you will get an output like the one below.

ntp.service - Network Time Service
  Loaded: loaded (/lib/systemd/system/ntp.service; enabled; vendor preset: enabled)
  Active: active (running) since Sun 2022-08-14 14:23:48 PST; 10h left
    Docs: man: ntpd (8)
Main PID: 80903 (ntpd)
   Tasks: 2 (limit: 3476)
  Memory: 3.2M
CGroup: /system.slice/ntp.service
L80901 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -U 131:139
Aug 14 03:26:39 ubuntu ntpd[80903]: Soliciting pool server 62.12.173.11
Aug 14 03:26:42 ubuntu ntpd[80903]: Soliciting pool server 91.189.89.198
Aug 14 03:27:45 ubuntu ntpd[80903]: Soliciting pool server 2001:4f8:110: 12c8: :2:123
Aug 14 03:27:47 ubuntu ntpd[80903]: Soliciting pool server 91.189.94.4,
Aug 14 03:28:51 ubuntu ntpd[80903]: Soliciting pool server 2001:8a8: 1005:1::11
Aug 14 03:28:53 ubuntu ntpd[80903]: Soliciting pool server 2001:67c:1560:8003::07
Aug 14 03:29:38 ubuntu ntpd[80903]: kernel reports TIME ERROR: Ox41: Clock Unsynchronized
Aug 14 03:29:57 ubuntu ntpd[80903]: Soliciting pool server 2001:440:1880:5555: :2
Aug 14 03:29:58 ubuntu ntpd[80903]: Soliciting pool server 2001:67c:1560:8003: :08
Aug 14 03:31:02 ubuntu ntpd[80903]: Soliciting pool server 2001:a98:11::40

Please take note that the command shared in this article is only executable for the Linux environment.

MD Aminul Islam avatar MD Aminul Islam avatar

Aminul Is an Expert Technical Writer and Full-Stack Developer. He has hands-on working experience on numerous Developer Platforms and SAAS startups. He is highly skilled in numerous Programming languages and Frameworks. He can write professional technical articles like Reviews, Programming, Documentation, SOP, User manual, Whitepaper, etc.

LinkedIn