Query a remote NTP server for the time

Simple post here, mainly for my own notes for the future.. but seem to have trouble finding the instructions on other websites.

The ntpq command works if you have the ntp package installed. Then the switch -c “rv 0 clock” and the host you want to query.

root@debianproxy:~# ntpq -c "rv 0 clock" uk.pool.ntp.org
reftime=e02eaff9.00000000 Sat, Mar 9 2019 21:34:49.000,
clock=e02eaff9.00000000 Sat, Mar 9 2019 21:34:49.000, version="4",
processor="ARMv7E-M", system="LeoNTP v1.13 Jan 2016", leap=00, stratum=1,
precision=-25, rootdelay=0.0, rootdisp=0.001, refid=GPS, peer=1, tc=3,
mintc=3, offset=0.001, frequency=0.0, sys_jitter=0.001, clk_jitter=0.001,
clk_wander=0.0

root@debianproxy:~# ntpq -c "rv 0 clock" 8.6.6.3 (um, fake ip, obviously).
clock=e02eadfd.a1e14c90 Sat, Mar 9 2019 21:26:21.632
This entry was posted in Uncategorized. Bookmark the permalink.

Comment on this topic