В этой статье мы расскажем, как проверить, работает ли 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
Пример выполнения команды:
recluse@sysadmin.ru:~$ ntpdate -q clock.isc.org
После выполнения команды в терминале будет выведена информация о текущем времени и разнице между локальным временем и временем на указанном NTP сервере.
Лицензионный ключ активации Windows от
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.
To check the time server configuration on a Windows machine using CMD, you can use the following command to display the current time server settings:
w32tm /query /status
Understanding Time Servers
What is a Time Server?
A time server is a server that provides accurate time information to client machines within a network. It uses protocols such as Network Time Protocol (NTP) to ensure all systems on the network operate on the same timeframe. This synchronization is critical for various computing processes, including data logging, transaction processing, and the overall integrity of time-sensitive applications.
Types of Time Servers
- NTP (Network Time Protocol) Time Servers: The most robust option, designed for high accuracy and reliability across the internet and local networks.
- SNTP (Simple Network Time Protocol): A simpler protocol than NTP that provides less accuracy but is easier to implement in less critical applications.
Restart Server Cmd: A Quick Guide to Reboot with Ease
How to Check Time Server Configuration in CMD
Opening Command Prompt
To interact with time servers using CMD, you first need to open Command Prompt. There’s a straightforward way to do this in Windows:
- Using Search: Click on the Start Menu and type «cmd» in the search bar. Click on Command Prompt from the results.
- Using Run command: Press `Windows + R`, type `cmd`, and hit Enter.
Basic CMD Commands Related to Time Servers
There are some key commands that you can utilize to interact with time servers effectively.
-
`net time`: This command checks the current time from the domain controller. It’s a quick way to see what the server’s time is compared to your local machine.
-
`w32tm`: This command is specifically related to Windows Time. It expands the functionality available for time synchronization and allows for more advanced configurations and diagnostics.
Using `net time`
Basic Usage
The command `net time` is your go-to for checking the time from the domain controller. To use it, simply enter:
net time
Upon execution, you’ll receive an output showing the current time and date from the server, which you can compare to your local machine’s time.
Synchronizing Time with Another Computer
If you want to synchronize your local machine’s time with another computer on the network, you can use the command:
net time \\ComputerName /set
Replace `ComputerName` with the name of the target computer. This command will set your local time to match that of the specified computer, ensuring synchronization across systems.
Using `w32tm`
Checking the Current Time Server Configuration
To see which time server your system is currently using, you can use:
w32tm /query /source
This command will return the source of your time synchronization. Understanding your current time server can help troubleshoot and ensure that you are aligned with a reliable time reference.
Troubleshooting NTP Issues
For an in-depth look at your NTP settings, run the following command:
w32tm /query /configuration
This command will display your NTP settings, including the time server to which your system is configured to synchronize. Recognizing these settings is critical when diagnosing synchronization issues.
Ping Server Cmd: Quick Guide to Testing Connectivity
Advanced Time Server Management with CMD
Configuring a Windows Time Service to Use NTP
If you want to change the time server your Windows machine uses for synchronization, you can configure it with the following command:
w32tm /config /manualpeerlist:"time.nist.gov" /syncfromflags:manual /reboot
In this command, replace `»time.nist.gov»` with your preferred time server. The parameters specify that synchronization will occur from manual peers only, which in this case would be the chosen time server.
Restarting the Windows Time Service
After configuring your time settings, it is often necessary to restart the Windows Time service to apply changes. Use the following commands:
net stop w32time
net start w32time
Restarting the service can help resolve synchronization issues and apply any configuration changes effectively.
Check FSMO Roles in Cmd: A Quick Guide
Common Issues and Fixes
Desynchronization Issues
Sometimes, systems may experience desynchronization due to various factors such as network issues or changes in reference clocks. To quickly diagnose and attempt to fix synchronization issues, you can run:
w32tm /resync
This command instructs your system to resynchronize with the configured time server immediately.
Firewall and NTP Issues
If synchronization continues to fail, it may be due to firewall settings blocking the necessary NTP traffic. You can check your firewall settings using Windows Firewall or third-party firewalls you may have in place, ensuring that ports for NTP (UDP port 123) are open.
Checksum Cmd: A Quick and Simple Guide
Conclusion
By leveraging the insights and commands outlined in this guide, you can effectively check and manage time servers using CMD. Time synchronization is a vital aspect of maintaining a stable and reliable computing environment, and mastering these commands will enhance your troubleshooting capabilities. If you have any questions or feedback regarding the practices discussed, feel free to reach out!
Check Port Cmd: A Quick Guide to Port Checking
References
For further reading and deepening your understanding, consider exploring more about time servers, relevant CMD commands, and best practices for network configurations. Recommended tools for monitoring time servers and their configurations can also be invaluable.
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!
Sometimes we need to retrieve the date from a NTP Network Time Protocol server to record it somewhere.
The first thing is to know if the server is working and reacheable from our computer (yep, firewalls still works). Then we can check the returned date format to adapt to our needs.
The most common thing is that we have to use a NIST server or a SNPT server. And, at the moment of checking them and programming, there is subtle differences between them.
Checking a NIST server
Check a NIST server is very straightforward. These servers listens on port 13, and responds to TCP or UDP requests. We can do a simple telnet or a netcat to check it. For example, if we wanted to check if time-c.nist.gov will work for us:
windows > run > cmd
1 |
telnet time-c.nist.gov 13 |
1 |
netcat time-c.nist.gov 13 |
Checking a SNTP server
Check a SNTP is not as straightforward as check a NTP server. SNTP servers uses the UDP protocol and the 123 port. Telnet or netcat won’t work for us… But we can use w32tm. For example, if we wanted to check if ntp02.oal.ul.pt will work for us:
windows > run > cmd
1 |
w32tm /stripchart /computer:ntp02.oal.ul.pt /dataonly /samples:1 |
Enjoy!
This post is licensed under CC BY 4.0 by the author.