How to query and test an NTP server using ntpdate

This tutorial explains how to manually set an exact time using ntpdate command.

It also explains how to test one or multiple Network Time Protocol servers using its query only feature.

1 Install ntpdate

If ntpdate is packed inside ntp, then the daemon will automatically synchronize the clock constantly.

#Arch based systems
pacman -S ntp
#Debian based systems
apt-get install ntpdate
#Red Hat based systems
dnf install ntpdate
#Red Hat based systems
yum install ntpdate
#SUSE based systems
zypper install ntp

2 Synchronize with NTP servers

This command will use all the IP addresses provided by the A / AAAA DNS records.


3 Test NTP servers

You may also use this NTP Server Online Tester.

The -q flag is for using the query only feature.

ntpdate -q