EN FR

NTP CLI Commands Reference

Complete command-line toolkit for testing time synchronization

ntpq - NTP Query Program

The standard query tool for systems running ntpd daemon.

Check NTP Peers Status

COMMAND
ntpq -p
EXAMPLE OUTPUT
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*ntp.rdem-system .GPS.            1 u   34   64  377    12.543   -0.284   1.023
+0.pool.ntp.org  .POOL.           2 u   42   64  377    28.123    0.842   2.156
-1.pool.ntp.org  .POOL.           2 u   38   64  377    35.421    1.234   3.421

Understanding the Output

ColumnMeaning
remoteNTP server hostname/IP
refidServer's reference (GPS, PPS, upstream server)
stStratum level (1=primary, 2-15=secondary)
whenSeconds since last response
pollPolling interval in seconds
reachReachability register (377 = all 8 attempts succeeded)
delayRound-trip delay in milliseconds
offsetTime difference in milliseconds
jitterVariation in offset measurements

Status Symbols

SymbolMeaning
*Current sync source (system peer)
+Candidate for sync (good quality)
-Outlier (not used)
xDesignated falseticker
#Selected but distance exceeds max
(space)Rejected or unreachable

Detailed Peer Information

COMMAND
ntpq -c peers -c as -c rv

Check NTP Associations

COMMAND
ntpq -c associations

chronyc - Chrony Client

For systems using chronyd (default on RHEL/CentOS 8+, Fedora, newer Ubuntu).

Check Synchronization Status

COMMAND
chronyc tracking
EXAMPLE OUTPUT
Reference ID    : C0A80001 (ntp.rdem-systems.com)
Stratum         : 2
Ref time (UTC)  : Tue Jan 14 10:30:45 2025
System time     : 0.000000234 seconds fast of NTP time
Last offset     : +0.000000012 seconds
RMS offset      : 0.000000156 seconds
Frequency       : 12.345 ppm slow
Residual freq   : +0.001 ppm
Skew            : 0.123 ppm
Root delay      : 0.012543210 seconds
Root dispersion : 0.000234567 seconds
Update interval : 64.0 seconds
Leap status     : Normal

Key Values to Monitor

  • System time: Current offset from NTP (should be < 1ms for good sync)
  • Last offset: Most recent time correction
  • Frequency: Clock drift rate in ppm (parts per million)
  • Stratum: Your system's stratum level (sync source + 1)

List NTP Sources

COMMAND
chronyc sources -v

Show Source Statistics

COMMAND
chronyc sourcestats

Force Immediate Sync

COMMAND
# Make a step correction if needed
sudo chronyc makestep

timedatectl - systemd Time Control

Universal tool available on all systemd-based Linux distributions.

Check Current Status

COMMAND
timedatectl status
EXAMPLE OUTPUT
               Local time: Tue 2025-01-14 11:30:45 CET
           Universal time: Tue 2025-01-14 10:30:45 UTC
                 RTC time: Tue 2025-01-14 10:30:45
                Time zone: Europe/Paris (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

Show Detailed Sync Info

COMMAND
timedatectl show-timesync --all

Enable/Disable NTP

COMMAND
# Enable NTP synchronization
sudo timedatectl set-ntp true

# Disable NTP synchronization
sudo timedatectl set-ntp false

w32tm - Windows Time Service

Built-in Windows tool for time synchronization management.

Query Current Status

COMMAND (CMD as Administrator)
w32tm /query /status /verbose

Check Configured Peers

COMMAND
w32tm /query /peers

Force Resync

COMMAND
w32tm /resync /force

Configure NTP Server

COMMAND
:: Set NTP server (run as Administrator)
w32tm /config /manualpeerlist:"pool-ntp.rdem-systems.com,0x8" /syncfromflags:manual /reliable:yes /update

:: Restart time service
net stop w32time && net start w32time

:: Force sync
w32tm /resync

One-Click Setup: RDEM Systems Stratum 2 Servers

Configure Windows to use our 3 high-precision NTP servers (AS206014). Copy and paste in PowerShell as Administrator:

w32tm /config /manualpeerlist:"pa3.pool-ntp.rdem-systems.com pa4.pool-ntp.rdem-systems.com pa5.pool-ntp.rdem-systems.com" /syncfromflags:manual /reliable:yes /update; net stop w32time; net start w32time; w32tm /resync /force

Servers located in France, contributing to NTP Pool Project

Monitor Time Sync (Real-time)

COMMAND
w32tm /monitor /domain:yourdomain.local

Quick Test Commands

Copy-paste these one-liners for rapid diagnostics:

Linux - Quick Health Check

ONE-LINER
# Check if NTP is working (chrony or ntpd)
(command -v chronyc && chronyc tracking) || (command -v ntpq && ntpq -p) || timedatectl status

Test NTP Server Connectivity

COMMAND
# Using ntpdate (deprecated but useful for testing)
ntpdate -q ntp.rdem-systems.com

# Using sntp
sntp -d ntp.rdem-systems.com

# Using nc (netcat) to test UDP 123
nc -vzu ntp.rdem-systems.com 123

Check Firewall (UDP 123)

COMMAND
# Linux (iptables)
sudo iptables -L -n | grep 123

# Linux (firewalld)
sudo firewall-cmd --list-all | grep ntp

# Linux (ufw)
sudo ufw status | grep 123

Service Status

COMMAND
# Check which NTP service is running
systemctl status chronyd ntpd systemd-timesyncd 2>/dev/null | grep -E "Active:|Loaded:"

Test Your NTP Now

Use our online tool to instantly check your system's time synchronization:

Run Live NTP Test Troubleshooting Guide