Windows Time Synchronization Fails When Using an NTP Server Hostname

Michael Wong 0 Reputation points
2026-11-27T14:35:48.2266667+00:00

Hi,

Windows successfully synchronizes its system clock when the NTP server is configured using an IP address, but fails when the corresponding hostname is used.

How can I determine whether the issue is related to DNS resolution, Windows Time Service configuration, or network connectivity?

Thanks for your help!

Michael

Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
0 comments No comments

2 answers

Sort by: Most helpful
  1. Jason Nguyen Tran 31,625 Reputation points Independent Advisor
    2026-11-27T15:22:30.63+00:00

    Hi Michael,

    Since sync works with the IP address, network connectivity on UDP 123 is probably fine, so I'd check things in this order:

    1. DNS resolution Run Resolve-DnsName <hostname> and confirm it returns the same IP you tested with. Also watch for extra records, like an IPv6 address or a second IP that your firewall might be blocking.
    2. Querying the server directly by hostname Run w32tm /stripchart /computer:<hostname> /samples:3 /dataonly. If this works but the service still won't sync, the problem is in the Windows Time configuration, not DNS.
    3. Windows Time configuration Use w32tm /query /configuration and w32tm /query /peers to confirm the hostname is entered correctly and has the right flag, for example ntp.contoso.com,0x8.
    4. Debug logging (if it's still unclear) Run w32tm /debug /enable /file:C:\w32time.log /size:10000000 /entries:0-300 and check the log. It shows exactly where the resolution or connection fails.

    I hope the response provided some helpful insight. If you find this answer useful, please hit “accept answer” so I know it addressed your concern.

    Jason

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-11-27T14:36:05.3166667+00:00

    If sync works with the NTP server’s IP address but fails with its hostname, start with DNS resolution. That pattern usually indicates name resolution is failing rather than NTP itself.

    Use this sequence:

    1. Verify the hostname resolves correctly.
      • Check that the NTP server name is spelled correctly in the configured NtpServer value.
      • Confirm DNS can resolve the hostname to the expected IP address.
      • If name resolution fails, the problem is DNS, not Windows Time.
    2. Confirm the Windows Time configuration.
      • Review the configured peer in the NtpServer registry entry.
      • For manual peers, ensure the server name or IP is valid.
      • If synchronizing with a non-Windows NTP server, configure Windows Time to use client mode instead of symmetric active mode:
             w32tm /config /manualpeerlist:<NTP_server_IP_Address>,0x8 /syncfromflags:MANUAL
             net stop w32time
             net start w32time
             w32tm /resync
        
      • The 0x8 flag sets client mode. This is important because some non-Windows NTP servers respond only to client mode requests.
      • If SpecialPollInterval is being used through the 0x1 flag, avoid that for this scenario; use 0x8 without 0x1.
    3. Check for the specific Windows Time error pattern.
      • If w32tm /resync returns “The computer did not resync because no time data was available”, the documented causes include:
        • DNS/name resolution failure
        • UDP port 123 blocked
        • The target server not advertising as an NTP server
      • An event such as DNS resolution error on a manual peer also points to hostname resolution as the issue.
    4. Test network connectivity for NTP.
      • Collect a network trace while running:
             w32tm /resync /rediscover
        
      • Interpret the result:
        • No outbound UDP 123 packets: likely blocked on local Windows Firewall.
        • Outbound UDP 123 packets with no reply: likely blocked on a network or non-Microsoft firewall.
        • Replies are present but sync still fails: investigate whether the target is properly serving NTP.
    5. If the target is a domain controller, verify it is advertising correctly.
      • Use w32tm /monitor to check whether domain controllers are receiving time from their source.
      • Run:
             dcdiag /test:Advertising
        
      • Verify these registry settings under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time:
        • On all DCs: TimeProviders\NtpServer → Enabled=1
        • On the PDC: Config → AnnounceFlags=5
        • On member DCs: Config → AnnounceFlags=10
    6. Use the result pattern to isolate the cause.
      • Works by IP, fails by hostname: DNS resolution issue is the primary suspect.
      • Fails by both IP and hostname, with no UDP 123 traffic: local firewall issue.
      • Fails by both IP and hostname, with outbound UDP 123 but no response: upstream firewall or network path issue.
      • Resolves name and reaches server, but still no sync: Windows Time mode/configuration or the target NTP server behavior.

    Caution: changing registry values or time source settings can affect domain authentication and time hierarchy behavior. Apply configuration changes carefully, especially on domain controllers.


    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.