
How to Set Up an NTP Server on Windows (Complete Guide)
Step-by-step instructions to enable, configure, check, and troubleshoot the NTP time server on Windows Server 2022, 2019, 2016, 2012 R2, and Windows 10/11 — via Registry, PowerShell, and Command Prompt.
time.windows.com by default; domain-joined machines follow the domain hierarchy up to the PDC emulator. Use w32tm /resync to force a sync and w32tm /query /status to check it.Table of Contents
- NTP Client vs. NTP Server on Windows
- How to Check the NTP Server in Windows
- How to Enable an NTP Server on Windows
- Configure NTP on Windows Server 2019 / 2022 (Domain Controller)
- w32tm Command Reference (Cheat Sheet)
- How to Add or Change the NTP Server Address
- Windows Server 2016 & 2012 R2 / 2012
- Set NTP in Windows 10 / 11
- How to Disable NTP Time Sync
- Troubleshooting NTP Sync Issues
- FAQ
- Sources & References
NTP Client vs. NTP Server on Windows: What’s the Difference?
Most “windows ntp server” searches actually cover two different jobs, and mixing them up is the #1 reason configuration doesn’t behave as expected:
| Role | What it does | When you need it | Key setting |
|---|---|---|---|
| NTP Client | Your Windows machine pulls time from an external NTP source (e.g. time.windows.com, pool.ntp.org) | Every standard PC, VPS, or server that just needs an accurate clock | /syncfromflags:manual + /manualpeerlist |
| NTP Server | Your Windows Server responds to time requests from other devices on your network | Domain controllers, isolated/air-gapped networks, or when other machines must sync to this box specifically | NtpServerEnabled = 1 + AnnounceFlags = 5 |
This guide covers both: configuring Windows as a client (sections 2, 6, 7, 8) and configuring Windows Server as a true NTP server for other machines (sections 3 and 4).
How to Check the NTP Server in Windows
Before changing anything, check what your machine is currently synced to. There are two ways: the GUI, or Command Prompt / PowerShell (faster, and works over RDP without a desktop session).
- Open Control Panel > Clock and Region > Date and Time.
- Go to the Internet Time tab.
- Click Change settings… to see the currently configured server, or Update now to force a sync.
Run these as Administrator to check NTP server, sync status, and stratum in seconds:
w32tm /query /source
w32tm /query /peers
w32tm /query /configuration
/query /status shows stratum, last successful sync, and the source; /query /peers lists every configured time server and its reachability.
sc query w32time or Get-Service w32time in PowerShell.How to Enable an NTP Server on Windows
To turn a Windows Server into an NTP server that other devices can query, you need to flip two registry values, restart the service, and open the firewall port. Pick Registry Editor or PowerShell — both do the same thing.
- Open Registry Editor — press
Win + R, typeregedit, press Enter. - Navigate to the NTP server key:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer - Enable the NTP server role: double-click
Enabledand set Value data to1, then click OK. - Set the AnnounceFlags: go to
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeConfig, double-clickAnnounceFlags, and set the value to5(Always Time Server + Always Reliable — see the reference table below). - Restart the Windows Time service: open
services.msc, find Windows Time, right-click → Restart. - Open UDP port 123 in Windows Firewall so clients can reach the server (see the firewall rule in the PowerShell tab — it works from an elevated Command Prompt too via
netsh advfirewall).
Run PowerShell as Administrator and execute each block in order:
1. Enable the NTP server role
2. Set AnnounceFlags to 5
3. Restart the service
4. Allow UDP 123 through the firewall
AnnounceFlags reference
| Value | Meaning | Typical use |
|---|---|---|
0 | Not set / not a time server | Default on plain clients |
1 | Always Time Server | Force the role on regardless of domain detection |
2 | Automatic Time Server | Server role only when the domain hierarchy assigns it |
4 | Always Reliable Time Source | Clients treat this server’s time as trustworthy |
5 | Always Time Server + Always Reliable (1+4) | Recommended for a manually configured, standalone NTP server |
10 (0xA) | Automatic Time Server + Automatic Reliable (2+8) | Default value on domain controllers |
How to Configure NTP Server in Windows Server 2019 / 2022 (Domain Controller)
Inside an Active Directory domain, time doesn’t sync randomly — it follows a strict hierarchy so every domain controller, member server, and client agrees on the same clock (critical for Kerberos, which fails outside a 5-minute skew by default). This applies the same way whether you’re on Windows Server 2019 or the newer 2022 time server settings.
- Identify the PDC emulator — only the domain’s PDC emulator FSMO role holder should sync to an external/internet time source; every other domain controller and member computer inherits time down the domain hierarchy automatically.
- On the PDC emulator only, point it at a reliable external source and mark it authoritative:
net stop w32time && net start w32time
- On every other domain controller (non-PDC), make sure they sync from the domain hierarchy instead of an external server:
net stop w32time && net start w32time
You can also manage this centrally through Group Policy: Computer Configuration > Administrative Templates > System > Windows Time Service > Time Providers, which exposes both Enable Windows NTP Server and Configure Windows NTP Client policies — useful when you need the same NTP server configuration in Windows Server 2019 domain controller and 2022 environments applied fleet-wide without touching every box by hand.
w32tm Command Reference (Cheat Sheet)
w32tm.exe is the command-line tool for the Windows Time service, available since Windows XP / Server 2008 and unchanged in structure through Server 2022. This is the fastest way to set, check, and force an NTP server sync from a terminal or RDP session.
| Task | Command |
|---|---|
| Check current NTP configuration | w32tm /query /configuration |
| Check sync status & stratum | w32tm /query /status |
| List configured NTP peers | w32tm /query /peers |
| Show current time source | w32tm /query /source |
| Force immediate resync | w32tm /resync /nowait |
| Set a manual NTP server (client mode) | w32tm /config /manualpeerlist:"server" /syncfromflags:manual /reliable:yes /update |
| Test a specific NTP server’s response | w32tm /stripchart /computer:server /dataonly /samples:5 |
| Restart the service (net commands) | net stop w32time then net start w32time |
| Restart the service (PowerShell) | Restart-Service w32time |
| Re-register the time service | w32tm /unregister then w32tm /register |
| Show current system time | time /T |
How to Add or Change the NTP Server Address
To point Windows at a different NTP source — your own server, a corporate time server, or a public pool — run:
net stop w32time
net start w32time
Replace [server] with a hostname or IP; separate multiple servers with spaces inside the quotes to add redundancy, e.g. "time.windows.com pool.ntp.org".
Common public NTP server addresses
| Server address | Operator | Notes |
|---|---|---|
time.windows.com | Microsoft | Windows default; Stratum 2 |
pool.ntp.org | NTP Pool Project | Community-run, geographically load-balanced |
time.nist.gov | NIST (U.S. government) | Backed by NIST’s atomic clocks |
time.google.com | Uses “leap smear” — not ideal to mix with non-smeared sources | |
time.cloudflare.com | Cloudflare | Also supports NTS (authenticated NTP) |
Windows Server 2016 & 2012 R2 / 2012
Windows Server 2016
Stop-Service w32time
Start-Service w32time
w32tm /resync
To enable the server role itself, set Enabled = 1 under HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW32TimeTimeProvidersNtpServer, same as newer versions. If the box runs as a VM, disable host time sync for that VM to avoid conflicts.
Windows Server 2012 / 2012 R2
Open an elevated Command Prompt and start the time service directly:
The server will begin synchronizing with its configured external NTP sources or domain hierarchy immediately after the service starts.
How to Set NTP Server in Windows 10 / 11
- Go to Control Panel > Clock, Language, and Region > Date and Time > Internet Time tab.
- Click Change settings…
- Check Synchronize with an Internet time server.
- Enter your preferred server address, or leave the default.
- Click Update now, then OK.
The same steps work identically for a windows ntp server address change on both Windows 10 and Windows 11 — the Settings app UI differs slightly, but Control Panel’s Internet Time tab is unchanged.
How to Disable NTP Time Sync on Windows
- Open Control Panel.
- Click Date and Time.
- Select the Internet Time tab.
- Click Change settings…
- Clear the checkbox for Synchronize with an Internet time server.
- Click OK to save, then close the dialog.
Or via PowerShell, stop and disable the service entirely:
Set-Service w32time -StartupType Disabled
Troubleshooting NTP Sync Issues
| Symptom | Likely cause | Fix |
|---|---|---|
w32tm /resync fails with an access error | Not running as Administrator | Re-open Command Prompt / PowerShell elevated |
| Clients can’t reach your NTP server | UDP 123 blocked | Add the inbound firewall rule shown in the “Enable NTP Server” section |
| Time keeps drifting on a VM | Hypervisor is also syncing the clock | Disable host time synchronization in the VM’s integration/guest services |
| Domain controller won’t sync externally | It isn’t the PDC emulator | Only the PDC emulator should use /syncfromflags:manual; others should use domhier |
w32tm /query /status shows “Error: 0x800705B4” | Time service not responding / stuck | Run w32tm /unregister then w32tm /register, then start the service again |
| Large clock offset, sync seems to do nothing | W32Time has a default correction limit | Force it with w32tm /config /update plus w32tm /resync /rediscover |
Frequently Asked Questions
Yes. Windows uses the Network Time Protocol through the built-in Windows Time service (W32Time) to keep the system clock accurate for logging, Kerberos authentication, and general network operations. Domain-joined machines sync automatically; standalone machines default to time.windows.com.
NTP always uses UDP port 123, both for outbound client requests and inbound requests if the machine is acting as a server. This is registered with IANA and doesn’t change across Windows versions.
Standalone/workgroup PCs default to time.windows.com. Domain-joined computers instead follow the domain time hierarchy up to the domain’s PDC emulator, which is the only machine that (by default) should point outward to an external source.
Run w32tm /query /status for sync status and stratum, w32tm /query /source for the current source, and w32tm /query /peers to see every configured server and whether it’s reachable.
Open an elevated Command Prompt and run w32tm /resync. If it reports “the computer did not resync because no time data was available,” check your NTP server address and firewall first.
Run w32tm /config /manualpeerlist:"ntp_server" /syncfromflags:manual /reliable:yes /update, replacing ntp_server with your chosen address, then restart the service with net stop w32time && net start w32time and run w32tm /resync.
Use net stop w32time followed by net start w32time in Command Prompt, or Restart-Service w32time in PowerShell. Both require an elevated (Administrator) session.
Run w32tm /query /source and w32tm /query /peers to confirm it’s syncing, or test a specific server’s response directly with w32tm /stripchart /computer:IPADDRESSORDNSNAME /dataonly /samples:5.
Yes — every registry change in this guide has a PowerShell equivalent using Set-ItemProperty, and service restarts can use Restart-Service w32time. See the PowerShell tab in the “Enable an NTP Server” section above.
No — the W32Time service, registry paths, and w32tm commands are identical across Server 2012 R2 through Server 2022. The only practical difference is the Settings app UI; Control Panel and PowerShell methods work the same on every version.
Sources & References
- Microsoft Learn – Windows Time Service overview
- Microsoft Learn – How the Windows Time Service works
- Microsoft Learn – w32tm command reference
- Microsoft Learn – Windows Time Service tools & settings
- Microsoft Learn – Configuring systems for high accuracy
- Microsoft Learn – Support boundary for time accuracy
- Microsoft Learn – W32Time registry entries
- Microsoft Learn – Configure the authoritative time server
- Microsoft Learn – Time sync in Active Directory
- Microsoft Learn – New-NetFirewallRule cmdlet
- Microsoft Learn – Windows Server networking docs hub
- Microsoft Learn – Restart-Service cmdlet
- IETF RFC 5905 – Network Time Protocol Version 4
- IETF RFC 1305 – Network Time Protocol Version 3
- NTP.org – The Network Time Protocol project
- NTP Pool Project – pool.ntp.org
- NIST – Internet Time Service server list
- IANA – Service Name & Port Number Registry (port 123)
- Wikipedia – Network Time Protocol
- Wikipedia – NTP Stratum levels
Need a Windows Server that’s ready to configure?
Spin up a clean Windows RDP or Windows Server instance with full admin access and set your NTP server in minutes.
