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
ntpq -p
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
| Column | Meaning |
|---|---|
| remote | NTP server hostname/IP |
| refid | Server's reference (GPS, PPS, upstream server) |
| st | Stratum level (1=primary, 2-15=secondary) |
| when | Seconds since last response |
| poll | Polling interval in seconds |
| reach | Reachability register (377 = all 8 attempts succeeded) |
| delay | Round-trip delay in milliseconds |
| offset | Time difference in milliseconds |
| jitter | Variation in offset measurements |
Status Symbols
| Symbol | Meaning |
|---|---|
| * | Current sync source (system peer) |
| + | Candidate for sync (good quality) |
| - | Outlier (not used) |
| x | Designated falseticker |
| # | Selected but distance exceeds max |
| (space) | Rejected or unreachable |
Detailed Peer Information
ntpq -c peers -c as -c rv
Check NTP Associations
ntpq -c associations
chronyc - Chrony Client
For systems using chronyd (default on RHEL/CentOS 8+, Fedora, newer Ubuntu).
Check Synchronization Status
chronyc tracking
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
chronyc sources -v
Show Source Statistics
chronyc sourcestats
Force Immediate Sync
# 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
timedatectl status
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
timedatectl show-timesync --all
Enable/Disable NTP
# 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
w32tm /query /status /verbose
Check Configured Peers
w32tm /query /peers
Force Resync
w32tm /resync /force
Configure NTP Server
:: 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)
w32tm /monitor /domain:yourdomain.local
Quick Test Commands
Copy-paste these one-liners for rapid diagnostics:
Linux - Quick Health Check
# Check if NTP is working (chrony or ntpd)
(command -v chronyc && chronyc tracking) || (command -v ntpq && ntpq -p) || timedatectl status
Test NTP Server Connectivity
# 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)
# 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
# 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:
More tools: browser-based NTP diagnostic · RDEM Systems NTP infrastructure · online NTP server validator