NTP on Windows Domain Controller
by Marshall Thacker
To configure an internal time server to synchronize with an external time source, follow these steps:
Change the server type to NTP. To do this, follow these steps:
1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters\Type
3. In the right pane, right-click Type, and then click Modify.
4. In Edit Value, type NTP in the Value data box, and then click OK.
Set AnnounceFlags to 5. To do this, follow these steps:
1. Locate and then click the following registry subkey:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags
2. In the right pane, right-click AnnounceFlags, and then click Modify.
3. In Edit DWORD Value, type 5 in the Value data box, and then click OK.
Enable NTPServer. To do this, follow these steps:
1. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
2. In the right pane, right-click Enabled, and then click Modify.
3. In Edit DWORD Value, type 1 in the Value data box, and then click OK.
Specify the time sources. To do this, follow these steps:
1. Locate and then click the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
2. In the right pane, right-click NtpServer, and then click Modify.
3. In Edit Value, type Peers in the Value data box, and then click OK.
Note Peers is a placeholder for a space-delimited list of peers from which your computer obtains time stamps. Each DNS name that is listed must be unique. You must append ,0x1 to the end of each DNS name. If you do not append ,0x1 to the end of each DNS name, the changes made in step 5 will not take effect.
Select the poll interval. To do this, follow these steps:
1. Locate following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval
2. In the right pane, right-click SpecialPollInterval, and then click Modify.
3. In Edit DWORD Value, type TimeInSeconds in the Value data box, and then click OK.
Note TimeInSeconds is a placeholder for the number of seconds that you want between each poll. A recommended value is 900 Decimal. This value configures the Time Server to poll every 15 minutes.
Configure the time correction settings. To do this, follow these steps:
1. Locate the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxPosPhaseCorrection
2. In the right pane, right-click MaxPosPhaseCorrection, and then click Modify.
3. In Edit DWORD Value, click to select Decimal in the Base box.
4. In Edit DWORD Value, type TimeInSeconds in the Value data box, and then click OK.
Note TimeInSeconds is a placeholder for a reasonable value, such as 1 hour (3600) or 30 minutes (1800). The value that you select will depend upon the poll interval, network condition, and external time source.
5. Locate the following registry subkey: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxNegPhaseCorrection
6. In the right pane, right-click MaxNegPhaseCorrection, and then click Modify.
7. In Edit DWORD Value, click to select Decimal in the Base box.
8. In Edit DWORD Value, type TimeInSeconds in the Value data box, and then click OK.
Note TimeInSeconds is a placeholder for a reasonable value, such as 1 hour (3600) or 30 minutes (1800). The value that you select will depend upon the poll interval, network condition, and external time source.
Quit Registry Editor.
At the command prompt, type the following command to restart the Windows Time service, and then press ENTER:
net stop w32time && net start w32time
--------------------
NTP.org pool info
If you're using a recent Windows version, you can use the ntp client that is built into the system.
As administrator enter
w32tm /config /syncfromflags:manual /manualpeerlist:0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org,3.pool.ntp.org
at the command prompt.
This will work on Windows 2003 and newer.
If you use an older version of windows you can try
net time /setsntp:"0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org"
Force a resync
If you want to force the client to resync, run:
C:\Windows\system32>w32tm /resync
Sending resync command to local computer
The command completed successfully.
If you get the following error, the computer can’t reach the NTP-server(s).
The computer did not resync because no time data was available.
Start from scratch
You can always do the following command and it will completely erase and add a default W32time configuration:
net stop w32time
w32tm /unregister
w32tm /register
When doing the unregister I got the following error, but it worked.
The following error occurred: Access is denied. (0×80070005)
Sometimes when doing the /register,
I would get.
The following error occurred: The specified service has been marked for deletion. (0×80070430)
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.