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:
- 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. - 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. - Windows Time configuration Use
w32tm /query /configurationandw32tm /query /peersto confirm the hostname is entered correctly and has the right flag, for examplentp.contoso.com,0x8. - Debug logging (if it's still unclear) Run
w32tm /debug /enable /file:C:\w32time.log /size:10000000 /entries:0-300and 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