В этой статье мы расскажем, как проверить, работает ли NTP сервер по указанному адресу в сети с помощью командной строки Windows или терминала в Linux.
Приобрести оригинальные ключи активации Windows всегда можно у нас в каталоге от 1099 ₽
Проверка NTP сервера в Windows
Для проверки работы NTP сервера в Windows, необходимо открыть командную строку и выполнить команду w32tm с нужными параметрами. Команда имеет следующий вид:
w32tm /stripchart /computer:[ИМЯ ИЛИ IP АДРЕС] /dataonly /samples:3
Например, чтобы проверить сервер clock.isc.org, нужно ввести следующую команду:
w32tm /stripchart /computer:clock.isc.org /dataonly /samples:3
Ответ будет содержать текущее локальное время и разницу со временем на указанном NTP сервере. Пример выполнения команды:
C:\Users\Recluse>w32tm /stripchart /computer:clock.isc.org /dataonly /samples:3
Отслеживание clock.isc.org [64.62.194.189:123].
Сбор образцов 3.
Текущее время - 07.06.2020 19:55:28.
19:55:28, +00.0777312s
19:55:30, +00.0786069s
19:55:32, +00.0779390s
Проверка NTP сервера в Linux
В Linux для проверки работы NTP сервера используется утилита ntpdate. Команда имеет следующий вид:
ntpdate -q [ИМЯ ИЛИ IP АДРЕС]
Для проверки сервера clock.isc.org, команда будет выглядеть так:
ntpdate -q clock.isc.org
Пример выполнения команды:
[email protected]:~$ ntpdate -q clock.isc.org
После выполнения команды в терминале будет выведена информация о текущем времени и разнице между локальным временем и временем на указанном NTP сервере.
Лицензионный ключ активации Windows от
microsoft-windows:win-command-line-tools:w32tm-manage-windows-time-service
Содержание
Утилита w32tm — Управляем службой времени в Windows
Как настроить NTP-сервер с помощью w32tm?
Как проверить статус синхронизации с NTP-сервером с помощью w32tm?
Проверяем текущее состояние службы времени и статус последней успешной синхронизации с NTP-сервером:
w32tm /query /Status
Индикатор помех: 0(предупреждений нет) Страта: 4 (вторичная ссылка - синхронизирована с помощью (S)NTP) Точность: -6 (15.625ms за такт времени) Задержка корня: 0.0937500s Дисперсия корня: 7.9058435s Идентификатор опорного времени: 0x0AA01008 (IP-адрес источника: 10.10.1.8) Время последней успешной синхронизации: 14.07.2020 14:53:05 Источник: DC01.ad.holding.com Интервал опроса: 10 (1024s)
Как проверить доступность NTP-сервера с помощью w32tm?
Отсылается 5 запросов на UDP порт 123 NTP-сервера следующим образом:
w32tm /stripchart /computer:DC01.ad.holding.com /dataonly /samples:5
Ответ от NTP-сервера получим примерно такой:
Отслеживание DC01.ad.holding.com [10.10.1.8:123].
Сбор образцов 5.
Текущее время - 21.12.2016 10:28:13.
10:28:13, +00.1740513s
10:28:15, +00.1764264s
10:28:17, +00.1788762s
10:28:19, +00.1871543s
10:28:21, +00.1868310s
· Последнее изменение: 14.07.2020 15:09 —
Алексей Максимов
Debian, Linux, Ubuntu, Windows, Windows 10, Windows 7, Windows 8, Windows Server, Windows Vista, Windows XP
- 08.06.2020
- 148 865
- 2
- 23.06.2021
- 66
- 65
- 1
- Содержание статьи
- Windows
- Linux
- Комментарии к статье ( 2 шт )
- Добавить комментарий
Если Вам потребовалось проверить, работает ли NTP сервер по определенному адресу в сети, то Вы можете легко это проверить через командную строку Windows, или терминал в Linux.
Windows
В Windows, нужно открыть командную строку и выполнить команду w32tm со специальными параметрами.
w32tm /stripchart /computer:[ИМЯ ИЛИ IP АДРЕС] /dataonly /samples:3
Например, для сервера clock.isc.org нужно написать вот так:
w32tm /stripchart /computer:clock.isc.org /dataonly /samples:3
Ответ будет содержать локальное время, и разницу со временем на указанном NTP сервере. Например:
C:\Users\Recluse>w32tm /stripchart /computer:clock.isc.org /dataonly /samples:3
Отслеживание clock.isc.org [64.62.194.189:123].
Сбор образцов 3.
Текущее время — 07.06.2020 19:55:28.
19:55:28, +00.0777312s
19:55:30, +00.0786069s
19:55:32, +00.0779390s
Linux
В Linux для проверки NTP сервера можно использовать утилиту ntpdate.
ntpdate -q [ИМЯ ИЛИ IP АДРЕС]
Для проверки сервера clock.isc.org команда приобретает следующий вид:
recluse@sysadmin.ru:~$ ntpdate -q clock.isc.org
Выглядеть её выполнение будет следующим образом:
recluse@sysadmin.ru:~$ ntpdate -q clock.isc.org
server 204.93.207.11, stratum 3, offset 0.005347, delay 0.15712
server 64.62.194.188, stratum 3, offset 0.003708, delay 0.20419
server 64.62.194.189, stratum 3, offset 0.002025, delay 0.19640
7 Jun 19:59:00 ntpdate[74019]: adjust time server 204.93.207.11 offset 0.005347 sec
How to Check NTP Server in Windows
As a system administrator, it’s crucial to ensure that your Windows-based system is configured to use the correct NTP (Network Time Protocol) server. NTP is a protocol used to synchronize the time on devices connected to a network. In this article, we will guide you on how to check the NTP server in Windows.
Why is it important to check NTP server in Windows?
- Ensures accurate system time: A correct NTP server setting ensures that your system time is accurate, which is essential for various applications such as logging, auditing, and security.
- Avoids time synchronization issues: Incorrect NTP server settings can cause time synchronization issues, leading to problems with system performance and reliability.
- Complies with security regulations: Many security regulations, such as PCI DSS, require accurate system time to ensure compliance.
How to check NTP server in Windows
There are two ways to check the NTP server in Windows:
Method 1: Using the Command Prompt
- Open the Command Prompt: Press the Windows key + R to open the Run dialog box, type
cmd
, and press Enter. - Type the command: Type the following command and press Enter:
w32tm /query /source
- Check the output: The command will display the current NTP server source. Look for the Source field, which should indicate the NTP server address.
Example output:
Source = <ntp.pool.ntp.org>
Method 2: Using the Windows Registry
- Open the Registry Editor: Press the Windows key + R to open the Run dialog box, type
regedit
, and press Enter. - Navigate to the registry key: In the Registry Editor, navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
- Check the NTP server setting: Look for the NtpServer value, which should contain the NTP server address.
Example registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
NtpServer = <ntp.pool.ntp.org>
How to change the NTP server in Windows
If you need to change the NTP server, you can do so by following these steps:
Method 1: Using the Command Prompt
- Open the Command Prompt: Press the Windows key + R to open the Run dialog box, type
cmd
, and press Enter. - Type the command: Type the following command and press Enter:
w32tm /config /manualpeerlist:<NTP_server_address> /syncfromflags:MANUAL
- Replace : Replace
<NTP_server_address>
with the new NTP server address.
Example command:
w32tm /config /manualpeerlist:ntp1.example.com ntp2.example.com /syncfromflags:MANUAL
Method 2: Using the Windows Registry
- Open the Registry Editor: Press the Windows key + R to open the Run dialog box, type
regedit
, and press Enter. - Navigate to the registry key: In the Registry Editor, navigate to the following key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
- Update the NTP server setting: Double-click on the NtpServer value and update the value to the new NTP server address.
Example registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters
NtpServer = <ntp1.example.com> <ntp2.example.com>
Conclusion
In conclusion, checking the NTP server in Windows is a crucial task to ensure accurate system time and compliance with security regulations. By following the methods outlined in this article, you can easily check and change the NTP server in Windows.
Additional Tips
- Use a reliable NTP server: Choose a reliable NTP server to ensure accurate time synchronization. You can use public NTP servers such as pool.ntp.org or time.nist.gov.
- Monitor NTP server status: Regularly monitor the NTP server status to ensure it is functioning correctly.
- Configure NTP server redundancy: Configure multiple NTP servers to ensure redundancy and minimize the risk of time synchronization issues.
NTP Server Configuration Table
NTP Server Configuration | Method 1 | Method 2 |
---|---|---|
Check NTP server source | w32tm /query /source |
Registry Editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters |
Change NTP server | w32tm /config /manualpeerlist:<NTP_server_address> /syncfromflags:MANUAL |
Registry Editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters |
By following this article, you will be able to check and change the NTP server in Windows, ensuring accurate system time and compliance with security regulations.
Your friends have asked us these questions — Check out the answers!
The other day I got a client asking for help syncing time across all Windows 10 thin clients with their NTP server. After taking a walk around NYC and witnessing many hanging shoes I refreshed my head I found a useful way to check Windows NTP configuration using the command prompt.
Using w32tm To Check and configure NTP using the Command Prompt
In Windows 10 open your command prompt and type the below command to check your current NTP configuration:
w32tm /query /configuration
The above gives you the current time configuration.
w32tm /query /status
The above shows you many more details, such as: stratum, precision, last sync, NTP server and etc..
time /T
This last one shows the current time.
At some Windows10 machines I got the below error:
The following error occurred: The service has not been started. (0x80070426)
This means the time service has is not running or disabled. I made sure to enabled accordingly either using the command prompt:
net start w32time
or at the services window when the above did not work:
There’s also a way to set and start Windows NTP configuration using the command prompt this way:
w32tm /config /manualpeerlist:10.0.0.5 /syncfromflags:manual /reliable:yes /update
Then, as usual Windows stays problematic. I had to run the below commands in sequence:
w32tm /unregister
w32tm /register
net start w32time
I did all these because I found out by running:
net time /querysntp
I got the deprecated error:
The /QUERYSNTP and /SETSNTP options have been deprecated. Please use w32tm.exe to configure the Windows Time Service.
At the end of the config you might need to run:
w32tm /config /update
w32tm /resync /rediscover
To make Windows 10 rediscover its NTP settings. Play around, research the official Windows documentation. You can also place all these command on a batch file and deploy it to all your clients.
Good luck! Contact me if you have any questions. Remember to check out my IT Handyman shop for cool T-Shirts and coffee mugs I designed once in a while.