How to Configure Your Windows Server to Use an External Time Source
Having the same time on all your Windows servers is extremely important. Microsoft Exchange, SQL Server, and Active Directory all rely on the Time Service (W32Time). The Kerberos authentication protocol in Windows also relies on the Time Service and if the time is out of sync on the servers, you can have some serious issues.
By default, the Windows computers use the following hierarchy to synchronize time with the servers.
- All client desktop computers synchronize time with the authenticating domain controller.
- All member servers also synchronize time with the authenticating domain controller.
- All domain controllers in a domain synchronize time with the primary domain controller (PDC) operations master.
- All PDC operations masters in each domain synchronize time with the PDC operations master in the forest root domain.
Microsoft recommends that you configure the authoritative time server to obtain the time from a hardware source because when you configure the authoritative time server to sync with an Internet time source there is no authentication. However, there are pros and cons to both using a hardware source and an Internet time source. Organizations often choose to synchronize time with an Internet time source because it is free and convenient. Here’s how you can configure a Windows Server to use an external time source on the Internet.
Step 1 – Change the Server Type to NTP
- Start Registry Editor and go to the following location:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type - Double-click Type and change the value to NTP.
- Click OK.
Step 2 – Enable NTP Server
- Locate the following location in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer - Double-click Enabled, type 1 and click OK.
Step 3 -Specify the Time Sources
- Go to the following location in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters - Double-click NtpServer and enter the following:
us.pool.ntp.org,0×1
You can list more than one time sources here. Use spaces to separate them. The important thing to remember is to add ,0x1 at the end of each DNS name. For more information check out Microsoft’s KB article 262680: A list of the Simple Network Time Protocol (SNTP) time servers that are available on the Internet. - Click OK.
Step 4- Configure the Time Correction Settings
- Go to the following location in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxPosPhaseCorrection - Double-click MaxPosPhaseCorrection and enter a decimal value in seconds. For example, for 30 minutes type 1800, for one hour type 3600 and then click OK.
- Go to the following key in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxNegPhaseCorrection - Double-click MaxNegPhaseCorrection and enter a decimal value in seconds. For example, for 30 minutes type 1800, for one hour type 3600 and then click OK.
Step 5 -Modify the Poll Interval
- Go to the following location in the registry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval - Double-click SpecialPollInterval and change the value to 900 and then click OK. This value sets the time in seconds so by setting it to 900 you are configuring the time server to poll every 15 minutes.
Step 6 – Restart Windows Time Service
- Go to the command prompt and type the following command.
net stop w32time && net start w32time
You just configured your server to automatically synchronize time with an Internet source. If you ever want to manually synchronize the time just type W32tm /resync at the command prompt.
I have tested this procedure successfully on Windows Server 2012 Datacenter, Windows Server 2008 R2 Enterprise and Windows Server 2003 R2 Enterprise. For more information and to configure the Windows time service to use an internal hardware clock, check out this KB article.
Copyright ©2013 Zubair Alexander. All rights reserved.