{"id":1663,"date":"2016-01-20T12:28:20","date_gmt":"2016-01-20T17:28:20","guid":{"rendered":"http:\/\/swildow.darktech.org\/wp\/?p=1663"},"modified":"2016-01-20T12:28:20","modified_gmt":"2016-01-20T17:28:20","slug":"configuring-ntp-server-2012","status":"publish","type":"post","link":"https:\/\/www.wildow.com\/blog\/?p=1663","title":{"rendered":"Configuring NTP Server 2012"},"content":{"rendered":"<p><a title=\"http:\/\/www.sysadminlab.net\/windows\/configuring-ntp-on-windows-server-2012\" href=\"http:\/\/www.sysadminlab.net\/windows\/configuring-ntp-on-windows-server-2012\">http:\/\/www.sysadminlab.net\/windows\/configuring-ntp-on-windows-server-2012<\/a><\/p>\n<p>This article explains how to configure NTP on Windows Server 2012. If you&#8217;re looking for Windows Server 2008 R2, see my article <a title=\"Configuring NTP on Windows 2008 R2\" href=\"http:\/\/www.sysadminlab.net\/windows\/configuring-ntp-on-windows-2008-r2\">here<\/a>. Remember, that in a domain environment, time synchronization is taken care of but you should configure the PDC Emulator of a domain to sync externally since that is the server which decides what time it is!<\/p>\n<p>Are you looking how to configure NTP using GPO, please read my article on it <a href=\"http:\/\/www.sysadminlab.net\/windows\/configuring-ntp-on-windows-using-gpo\">here<\/a>.<\/p>\n<p>This is all you need if you want to keep it simple. Run using PowerShell as admin:<\/p>\n<blockquote><p>w32tm \/config \/manualpeerlist:pool.ntp.org \/syncfromflags:MANUAL<br \/>\nStop-Service w32time<br \/>\nStart-Service w32time<\/p><\/blockquote>\n<p>If the machine is a VM inside Hyper-V, you have to\u00a0<a href=\"http:\/\/www.virtualizationadmin.com\/kbase\/VirtualizationTips\/ServerVirtualization\/MicrosoftHyper-VTips\/PerformanceandScalability\/DisablingTimeSyncinaVM.html\">disable time sync<\/a>. Open VM settings -&gt; Management -&gt; Integration Services and uncheck Time Synchronization.<\/p>\n<p><strong>That should be it!\u00a0<\/strong>Want to know more? Doesn&#8217;t work? Have you screwed up the config and want to start from the beginning? Keep on reading&#8230;<\/p>\n<p><a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/cc773263%28WS.10%29.aspx\">W32tm<\/a>\u00a0is the command to use. Sure, there are articles out there mentioning &#8220;net time&#8221;, but you should not use that. Some other also mentions editing the registry directly, but as Microsoft mentions in the article:\u00a0<em>It is recommended that you do not directly edit the registry unless there is no other alternative<\/em>. But if you really want to check the registry, it&#8217;s here:\u00a0<strong>HKLM\\System\\CurrentControlSet\\Services\\W32Time<\/strong>.<\/p>\n<h3>Which NTP-server to use? Or several?<\/h3>\n<p><a href=\"http:\/\/support.ntp.org\/bin\/view\/Servers\/NTPPoolServers\">The pool.ntp.org is a round-robin<\/a>\u00a0of random selected NTP servers. As they say &#8220;<em>This is usually good enough for end-users<\/em>&#8220;. But you might want to add several NTP-servers yourself for redundancy?<\/p>\n<blockquote><p>w32tm \/config \/manualpeerlist:&#8221;0.pool.ntp.org 1.pool.ntp.org&#8221; \/syncfromflags:MANUAL<\/p><\/blockquote>\n<p>Just keep adding them with a space in between them. Yes, I know some sites say you should separate them using comma but that doesn&#8217;t work. Also, I&#8217;ve experienced issues that it configures correctly, but still after restarting the service, it doesn&#8217;t work. I just needed to do the configuration again, and try once more. Also, remember that cut&#8217;n&#8217;paste from the web can sometimes screw up the &#8221; character so write it manually instead of cut&#8217;n&#8217;paste to be sure.<\/p>\n<h3>Don&#8217;t forget your firewall<\/h3>\n<p>If you got a firewall between your host and the Internet, it might drop udp\/123 which is the NTP protocol. This is how it looked in my Cisco ASA FW:<\/p>\n<p><a href=\"http:\/\/www.sysadminlab.net\/wp-content\/uploads\/NTP_dropped_in_Cisco_FW.png\"><img loading=\"lazy\" decoding=\"async\" title=\"NTP_dropped_in_Cisco_FW\" src=\"http:\/\/www.sysadminlab.net\/wp-content\/uploads\/NTP_dropped_in_Cisco_FW.png\" alt=\"\" width=\"862\" height=\"99\" \/><\/a><\/p>\n<p>So I created a rule to allow it and after that it worked.<\/p>\n<p><a href=\"http:\/\/www.sysadminlab.net\/wp-content\/uploads\/NTP_allowed_in_Cisco_ASA.png\"><img loading=\"lazy\" decoding=\"async\" title=\"NTP_allowed_in_Cisco_ASA\" src=\"http:\/\/www.sysadminlab.net\/wp-content\/uploads\/NTP_allowed_in_Cisco_ASA.png\" alt=\"\" width=\"397\" height=\"34\" \/><\/a><\/p>\n<h3>More info and debug logging<\/h3>\n<p>The following commands are quite useful which lists the current source, when it last sync&#8217;ed etc.<\/p>\n<blockquote><p>w32tm \/query \/status<\/p><\/blockquote>\n<p>Eventually, when the server\u00a0can&#8217;t\u00a0get time from the NTP server it will add an event to the event log:<\/p>\n<p><em>Log Name: System<br \/>\nSource: Microsoft-Windows-Time-Service<br \/>\nEvent ID: 47<br \/>\nLevel: Warning<br \/>\nDescription: Time Provider NtpClient: No valid response has been received from manually configured peer pool.ntp.org after 8 attempts to contact it. This peer will be discarded as a time source and NtpClient will attempt to discover a new peer with this DNS name. The error was: The peer is unreachable.<\/em><\/p>\n<p>Otherwise, when it&#8217;s working, you will get:<\/p>\n<p><em>Log Name: System<br \/>\nSource: Microsoft-Windows-Time-Service<br \/>\nEvent ID: 35<br \/>\nLevel: Information<br \/>\nDescription: The time service is now synchronizing the system time with the time source pool.ntp.org (ntp.m|0x0|0.0.0.0:123-&gt;85.10.240.253:123).<br \/>\n<\/em><\/p>\n<div class=\"ezAdsense adsense adsense-midtext\"><ins id=\"aswift_1_expand\"><ins id=\"aswift_1_anchor\"><iframe id=\"aswift_1\" name=\"aswift_1\" width=\"468\" height=\"60\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/ins><\/ins><\/div>\n<p>You still getting problems? You can easily turn on debugging to a logfile which in this case is limited t0 10 MB and include ALL debug entries.<\/p>\n<blockquote><p>w32tm \/debug \/enable \/file:C:\\Temp\\w32tmdebug.log \/size:10485760 \/entries:0-300<\/p><\/blockquote>\n<p>Turn it off again with:<\/p>\n<blockquote><p>w32tm \/debug \/disable<\/p><\/blockquote>\n<p>Expect a\u00a0lot\u00a0of info in this debug log. For me, when it worked, the following entries showed it was working:<\/p>\n<p><em>&#8211; Reachability:\u00a0 peer pool.ntp.org (ntp.m|0x0|0.0.0.0:123-&gt;129.70.132.35:123) is reachable.<br \/>\n&#8211; Logging information: NtpClient is currently receiving valid time data from pool.ntp.org (ntp.m|0x0|0.0.0.0:123-&gt;129.70.132.35:123).<br \/>\n<\/em><\/p>\n<p>But when I had my firewall blocking the packets, I would get the following. Don&#8217;t trust this too much though, since I did get this when I allowed it in the firewall also, but when it was blocked, I did not get the entries above.<\/p>\n<p><em>&#8211; Logging error: NtpClient has been configured to acquire time from one or more time sources, however none of the sources are currently accessible and no attempt to contact a source will be made for 1 minutes. NTPCLIENT HAS NO SOURCE OF ACCURATE TIME.<\/em><\/p>\n<h3>Force a resync<\/h3>\n<p>If you want to force the client to resync, run:<\/p>\n<blockquote><p>w32tm \/resync<br \/>\nSending resync command to local computer<br \/>\nThe command completed successfully.<\/p><\/blockquote>\n<p>If you get the following error, the computer can&#8217;t reach the NTP-server(s).<\/p>\n<p><em>The computer did not resync because no time data was available.<\/em><\/p>\n<p><strong>Start from scratch<\/strong><\/p>\n<p>If you completely screwed up the config, you can always do the following command and it will completely erase and add a default W32time configuration:<\/p>\n<blockquote><p>Stop-Service w32time<br \/>\nw32tm \/unregister<br \/>\nw32tm \/register<\/p><\/blockquote>\n<p>When doing the unregister I got the following error for some reason, but it seems like it worked anyway.<\/p>\n<p><em>The following error occurred: Access is denied. (0x80070005)<\/em><\/p>\n<p>Sometimes when doing the \/register, I would get the following. This usually solved by waiting for a while. I would suggest you stop the service before doing \/unregister. Otherwise, a reboot would probably solve most problems.<\/p>\n<p><em>The following error occurred: The specified service has been marked for deletion. (0x80070430)<\/em><\/p>\n<p>If you miss any important information, let me know and I&#8217;ll add it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/www.sysadminlab.net\/windows\/configuring-ntp-on-windows-server-2012 This article explains how to configure NTP on Windows Server 2012. If you&#8217;re looking for Windows Server 2008 R2, see my article here. Remember, that in a domain environment, time synchronization is taken care of but you should configure &#8230; <a class=\"more-link\" href=\"https:\/\/www.wildow.com\/blog\/?p=1663\">Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1663","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1663"}],"version-history":[{"count":1,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1663\/revisions"}],"predecessor-version":[{"id":1664,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1663\/revisions\/1664"}],"wp:attachment":[{"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wildow.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}