← All posts
April 9, 20241 min read

Windows Time Server Fix

Changing which NTP server Windows syncs its clock against via the registry.

#windows#networking

Change the time server on Windows

  1. Open Run (Win+R), type regedit, and hit Enter.
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers.
  3. Add a new string value — the name is an integer (1, 2, 3, …) and the value is the time server's address. Popular choices:
    • us.pool.ntp.org
    • time.google.com, time1.google.com … time4.google.com
    • time-a-g.nist.gov
  4. The (Default) entry's value is the integer key of whichever server should actually be used — e.g. if time.google.com is registered under 3, set (Default) to 3.

That registry key only feeds the Date & Time control-panel dropdown. The actual Windows Time service reads W32Time settings under HKLM\SYSTEM\CurrentControlSet\Services\W32Time, so to change what the service itself syncs from you need w32tm below.

Actually forcing the sync

Diagnose first:

w32tm /query /status
w32tm /query /peers
w32tm /resync

Point the service at a specific server:

w32tm /config /manualpeerlist:"time.google.com,0x8" /syncfromflags:manual /update
net stop w32time && net start w32time
w32tm /resync

NTP runs over UDP 123 — if a firewall blocks it, w32tm /resync fails with "no time data was available".

Reference