- Documentation
Elastic Compute Service
Elastic Compute Service
Best Practices
ECS instance local time synchronization
Configuring NTP service for Windows instances
ECS instance local time synchronization
Configuring NTP service for Windows instances
Configuring NTP service for Windows instances
This topic describes how to use the NTP service to synchronize the local time of Windows instances. In the example provided in this topic, Windows Server 2019 Datacenter Edition 64 bit is used.
What is NTP?
Network Time Protocol (NTP) is an application-layer protocol in the TCP/IP protocol suite, designed for clock synchronization between clients and servers and providing highly accurate time calibration.
Procedure
You can enable and configure the NTP service by using either the Graphical User Interface (GUI) or the command line.
GUI-based configuration
Command line-based configuration
Step 1: Enable the NTP service
By default, the Windows Time service is enabled in the Windows Server operating system. To ensure that time synchronization works as expected after the NTP service is configured, you need to enable the NTP service in the instance. Perform the following steps to check and enable the NTP service:
- Click the Windows Start icon, click "Windows System", and then click "Run". In the Run window, execute the services.msc command.
- In the "Services" window, locate and double-click "Windows Time".
- In the "Windows Time Properties (Local Computer)" window, select the "General" tab and modify the following settings:
- Set "Start type" to "Automatic".
- Make sure that the value of "Service status" is "Running". Otherwise, click the “Start” button to start the Windows Time service.
- After you click the "Apply" button, click the "OK" button to enable the NTP service.
Step 2: Modify the default NTP server address
By default, the Microsoft NTP server (time.windows.com) is configured for the Windows Server operating system. You can change the default NTP server to the NTP server you want to use.
- In the notification area of the taskbar, click the date and time, and then click the "Change date and time settings" button.
- In the "Related settings" section of the "Date & time" window, click the "Add clocks for different time zones" button.
- In the newly opened "Date and Time" window, click the "Internet Time" tab, and then click the "Change settings" button.
- In the "Internet Time Settings" window, select the "Synchronize with an Internet time server" option, and enter the NTP server address you want to use in the "Server" text box.
- Click the "Update now" button. Windows immediately synchronizes time with the NTP server.
- Click the "OK" button to complete the modification of the NTP server address.
Step 3: Modify the time synchronization interval for the NTP service (optional)
The default time synchronization interval is 400 (in hexadecimal, equivalent to 1024 seconds, or approximately 17 minutes). You can specify a custom time synchronization interval for the NTP service based on your needs. Perform the following steps to modify the time synchronization interval:
- Click the Windows Start icon, click "Windows System", and then click "Run". In the Run window, execute the regedit command.
- In the left directory tree of the "Registry Editor" window, select "HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > W32Time > TimeProviders > NtpClient".
- In the "Name" column of the details window on the right, double-click "SpecialPollInterval".
- In the "Edit DWORD (32-bit) Value" window, set "Base" to "Decimal" and enter a value in the "Value data" field based on your needs. The value you enter is the synchronization interval you need, in seconds.
- Click the "OK" button to complete the modification operation.
- After you complete the modification, you need to restart the instance or the service for the configuration to take effect. If you do not want to restart the instance due to your business requirements, you can perform the following steps to restart the service for the modification to take effect.
- Click the Windows Start icon, click "Windows System", and then click "Run". In the Run window, execute the services.msc command.
- In the "Services" window, locate and right-click "Windows Time".
- Click the "Restart" button to restart the service.
- Click the "Windows" icon, right-click "Command Prompt" in "Windows System", and then click "Run as administrator" under "More".
- Execute the following command in the Command Prompt window to enable the NTP service and set "Startup type" to "Automatic".
- Modify the default NTP server address.
- Execute the following command in the Command Prompt window to modify the address of the NTP service.
tip
- In the example provided in this section, the NTP service address is changed to the Volcano Engine NTP server address. To specify other NTP servers, replace ntp0.ivolces.com, ntp1.ivolces.com, ntp2.ivolces.com, and ntp3.ivolces.com with the actual server addresses.
- (Optional) Modify the time synchronization interval for the NTP service
- Execute the following command in the Command Prompt window to modify the time synchronization interval settings in the NTP configuration of the registry.
tip
In the example provided in this topic, the time synchronization interval is set to 600 seconds. You can convert your desired time interval to hexadecimal and replace 258 in the command with this converted value.
- Execute the following commands in the Command Prompt window to restart the time service and resynchronize the time.
- Execute the following command in the Command Prompt window to query the time synchronization status.
FAQ
What do I do if the modification fails to take effect after I change the default NTP server address to the Volcano Engine address and restart the Windows Time service?
This failure may be caused by conflicts between different registry configurations when you configure the NTP server. Refer to the following steps to cancel the Windows Time configuration in the local group policy.
- Execute the following command in the elevated command prompt to reconfigure the NTP server address.
- Click the Windows Start icon, click "Windows System", and then click "Run". In the Run window, execute the following command to open the Local Group Policy Editor.
- Double-click "Configure Windows NTP Client", and in the pop-up window, select Not Configured.
- Click the "Apply" button, and then click the "OK" button to complete the operation.
tip
After you modify the configuration, the "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32Time" registry key automatically disappears.
- Execute the following commands in the Command Prompt window to restart the time service and resynchronize the time.
- Execute the following command in the Command Prompt window to verify whether time synchronization can be performed as expected.
Last updated: 2026.06.17 19:32:52