How to verify NTP is working Or not (Check Status of NTP)

To verify if NTP (Network Time Protocol) is working or not and check the status of NTP, you can use the following commands:

  1. Check if the NTP daemon is running:
sudo systemctl status ntp

This will show you the status of the NTP daemon and whether it is running or not. If it is not running, you can start it with the command:

sudo systemctl start ntp
  1. Check the NTP synchronization status:
ntpq -p

This will show you the status of the NTP synchronization. If the output shows a list of servers and their state as * or +, it means that the NTP daemon is synchronized and working correctly.

For example, a typical output of the ntpq -p command would look like:

remote refid st t when poll reach delay offset jitter
==============================================================================
+ntp.example.com 192.168.1.1 3 u 25 64 7 0.124 -0.056 0.049
-ntp2.example.com 192.168.1.2 2 u 24 64 7 0.121 -0.056 0.048
-ntp3.example.com 192.168.1.3 2 u 23 64 7 0.121 -0.056 0.049

In this output, the server ntp.example.com is selected as the primary time source, denoted by the * symbol. The other servers are also reachable and providing time, but not currently selected as the primary time source.

If the synchronization status shows a different symbol such as x or -, it means that the NTP daemon is not synchronized with any servers or there is a problem with the time synchronization.

Note that the ntpq command may not be installed by default on your system. You may need to install it using the package manager for your distribution before you can use it.

Leave a Comment