Why does my Linux clock keep drifting out of sync?
Diagnose and fix Linux clock drift and NTP sync issues using chrony, timedatectl, and network checks.
What this covers
Linux clock drift usually means NTP or chrony isn't syncing, or the timezone is misconfigured. Work through the checks below to find the cause and fix it.
Symptom
Check whether chrony is actually syncing your clock
This is the fastest way to see if your clock is being corrected. The tracking output shows the current offset, stratum, and reference server; the sources output lists which NTP servers are reachable. If the reference ID is .LOCL, the stratum is 0, or the offset is seconds instead of milliseconds, NTP is not working.
Verify that chrony is keeping the clock accurate and which NTP servers it uses.
$ chronyc tracking && chronyc sources -vCorrect the timezone if it is wrong
Clock drift and wrong timezone are different problems, but a misconfigured timezone makes every timestamp look wrong and can confuse your diagnosis. Use timedatectl to set the correct timezone, then check that the NTP service is enabled and active. This step is optional if your timezone is already correct.
timedatectl lists, sets, and verifies the system timezone and NTP sync status on systemd distributions.
$ sudo timedatectl set-timezone Asia/Shanghai▾ Undo
$ sudo timedatectl set-timezone UTCVerify network stability to your NTP server
NTP needs a stable network path. Run a continuous ping to the NTP server or your gateway and watch for packet loss or large latency spikes. If replies are steady and timestamps are consistent, the network is not the reason sync fails; if you see loss, fix the network before expecting NTP to hold time.
Keep pinging a host until interrupted while printing a Unix timestamp on every reply — perfect for correlating packet loss with events.
$ ping -D 8.8.8.8How to confirm it worked
Run `chronyc tracking` again and confirm the offset is small (under a few milliseconds), the stratum is not 0, and the reference ID is a real NTP server. Also check `timedatectl` shows NTP synchronized: yes.
Undo everything
Every command above can be reverted. Run these in order to undo all of it.
$ sudo timedatectl set-timezone UTCReview before running — some steps may not be independent.
Sources
- chrony documentationEvidence: Official documentation for the tracking and sources commands and the meaning of Leap/Stratum/Root delay fields.
- timedatectl(1) - Linux manual pageEvidence: timedatectl set-timezone sets the system timezone, list-timezones shows available zones, and set-ntp controls network time synchronization.
- ping(8) — send ICMP ECHO_REQUEST to network hostsEvidence: Documents -D to print timestamps before each line and -i interval / -c count semantics.
- chronyc(1) - command-line interface for chronyEvidence: chronyc tracking reports system time, last offset and stratum; chronyc sources shows the NTP servers chrony is using and their reach/state.
Last verified: 2026-09-22
Related guides
A step-by-step systemd troubleshooting guide: check status, read the journal, fix the unit file, reload, and restart.
A step-by-step terminal checklist to check disk health on Linux: rule out full space and inodes, read the SMART self-assessment, and check live I/O per process.
A problem-fix walkthrough for a full Linux disk: find the culprit filesystem, remove space hogs, sweep caches, and verify the space came back.