Configuring the Primary Time Server
To establish a stable time reference, designate one of your Windows 11 machines as the primary server. This PC will sync with an external internet time source, while the second PC will sync exclusively with this local server. Start by opening an elevated Command Prompt. You can quickly access this by right-clicking the Start button and selectingTerminal (Admin) or searching for cmd in the Start menu and running it as administrator. For convenience, consider following the guide on How to Pin CMD to the Taskbar in Windows 11 to streamline future administrative tasks.
First, stop the current time service using the command:
net stop w32time
Next, configure the server to use a reliable external source, such as Microsoft’s public time servers. Run the following commands to set the type to NTP and specify the source:
w32tm /config /syncfromflags:manual /manualpeerlist:"time.windows.com,0x8 time.microsoft.com,0x8" /update
The 0x8 flag indicates that these are special peers, ensuring high priority. After updating the configuration, restart the service:
net start w32time
Verify the configuration by checking the status:
w32tm /query /configuration
Ensure the output shows Type: NTP and lists your chosen peers. If the service fails to start, check the Event Viewer under Applications and Services Logs > Microsoft > Windows > Time-Service for detailed error messages.
Setting Up the Client PC
On the second Windows 11 PC, configure the system to trust the first PC as its sole time source. Open an elevated Command Prompt on this client machine. Stop the time service again:net stop w32time
Configure the client to synchronize with the IP address or hostname of the primary server. Replace SERVER_IP with the actual local IP address of your primary machine:
w32tm /config /syncfromflags:manual /manualpeerlist:"SERVER_IP" /update
Restart the service:
net start w32time
Force an immediate synchronization attempt to verify connectivity:
w32tm /resync
If the resync fails, the issue is likely network-related rather than configuration-based. Proceed to the next section to ensure your firewall allows this communication.
Firewall Configuration for Local Sync
Windows Firewall often blocks incoming NTP traffic, especially if the connection profile is set to Public. To allow the client to reach the server, you must permit UDP port 123 on the primary machine. OpenWindows Defender Firewall with Advanced Security. Create a new Inbound Rule by selecting New Rule under Actions. Choose Port and select UDP, specifically for Specific local ports entering 123.
Allow the connection for all profiles, though restricting it to Private may suffice if both PCs are on a trusted home network. Name the rule "Windows Time Service NTP" and finish the wizard. On the client side, no inbound rule is needed, but ensure outbound UDP 123 is allowed. Test the sync again with w32tm /resync. A successful response confirms the firewall is correctly configured.
For broader network management tips, you might also find value in reading about Control volume with key bindings in Windows 11 to optimize your overall workflow efficiency.
Verifying Synchronization Accuracy
After configuring both machines, verify the accuracy of the synchronization. Use the following command on the client PC:w32tm /query /status
Look for the Source field. It should display the IP address of your primary server, not an external internet source. Check the Stratum level; it should be higher than the server’s stratum (e.g., if the server is stratum 2, the client should be stratum 3). The Last Successful Sync Time should reflect the recent resync attempt.
If discrepancies persist, check the time offset. A small drift of a few milliseconds is normal. Large offsets indicate a deeper network or configuration issue. Ensure both PCs have similar hardware clocks and that no other software, such as third-party antivirus suites, is interfering with the W32Time service.
Frequently Asked Questions
Why does my PC still sync to the internet instead of the local server?
This usually happens if the manual peer list is not correctly applied or if the /update flag was missed. Verify the configuration with w32tm /query /configuration to ensure SyncFromFlags is set to Manual. Restarting the service after changing settings is critical.
Can I use a domain controller as the time source?
Yes, in a domain environment, clients typically sync with the domain controller, which itself syncs with the PDC emulator. For standalone PCs like those described, manual NTP configuration is the correct approach. Mixing domain and workgroup setups requires careful group policy management.
What if the firewall blocks UDP 123 despite being open?
Check if your antivirus software has its own firewall layer that overrides Windows Defender settings. Some security suites block unsolicited incoming UDP traffic even if Windows rules allow it. Temporarily disable third-party firewalls to test if they are the culprit.
Is it safe to leave the time server exposed on a Public network profile?
No, exposing NTP services on a Public profile increases attack surface. Always set your network location to Private for trusted local networks. Restrict the firewall rule to specific IP addresses if possible, rather than allowing any source.
How do I reset the time service if it becomes unresponsive?
You can reset the configuration to defaults by running w32tm /unregister followed by w32tm /register, then restarting the service. This clears corrupted registry keys related to time synchronization. Avoid doing this frequently unless troubleshooting persistent errors.