Перейти к содержимому

Как узнать ntp сервер

  • автор:

Как найти IP-адрес NTP-сервера (за 3 шага)

Сервер протокола сетевого времени (NTP) — это машина, которая действует как сервер синхронизации между всеми клиентскими компьютерами. Если ваш компьютер настроен на синхронизацию с сервером таймера в сети, ваши часы будут показывать то же время, что и это. Когда администратор изменяет время (на летнее время), все клиентские машины в сети обновляют свое время. Это полезно для администраторов, которым необходимо синхронизировать часы для использования настольных приложений или процессов. Вы можете узнать IP-адрес NTP-сервера, получив NTP-сервер с компьютера и используя команду «ping» или сниффер пакетов.

Шаг 1

В Windows нажмите кнопку «Пуск» и выберите «Выполнить». Введите «cmd» в поле «Выполнить» и нажмите «ОК». Откроется окно командной строки.

Шаг 2

Введите «Net Time / querysntp» в окне командной строки и нажмите клавишу «Enter». Это покажет настройки вашего сервера NTP. Он также покажет имя сервера, с которым вы можете использовать команду «ping» для получения IP-адреса.

Шаг 3

Введите "пинг" "в окне командной строки и нажмите клавишу" Enter ". Заменить" "с именем, полученным на втором шаге. В результате вы получите IP-адрес NTP-сервера.

How to Find NTP Server in a Domain to Sync All PCs

To keep all PCs synchronized, updating the internet time will help you pull it off. And to do that, you need to find the NTP (Network Time Protocol) server first.

Windows’ Command Prompt will get you there. And if you don’t know where to begin, don’t worry.

In this post, you’ll learn what you need on how to find the NTP server for the domain.

Register and Start

If you haven’t registered Windows Time Service yet, the commands below will show you how to do it. You also need to start the service before you can sync your computer time with your NTP server.

First up is to launch the Command Prompt. Choose Run as administrator.

Then enter the following command to register your system: w32tm /register

Once you hit enter, you will find out if the registration was a success.

Now, start things up by issuing this command: sc start w32time

W32tm /query

Now that the Windows Time Service is registered and running, you can get information from it. You can do this by typing the following: w32tm /query and match it with the following parameters.

/status

This will show you the status of Windows Time Service.

/status /verbose

This will set the verbose mode to show you more information.

/source

This will show you the time source.

/configuration

This will show you the run-time’s configuration and settings.

/peers

This will show a list of people using your system.

W32tm /resync

You can also use the Command Prompt to resynchronize the clock the soonest time possible.

Here’s a discussion on each parameter of this command:

/computer:<name of computer to be resynchronized>

This lets you specify a computer that will be resynchronized. If you leave this blank, the subject will be the local computer.

/nowait

This lets you eliminate the wait time for the resynchronization. It means that you will not have to wait for the process to be completed before the results are returned.

This lets you resync the clock using the existing errors. Of course, this wouldn’t do you any good. But you can refer to the information it provides for compatibility.

W32tm /config

Use this command to configure your system.

Let’s look at its components:

/manualpeerlist:

This lets you set a list of peers. It’s a list of IP addresses.

You can leave it blank and by default, it will be set to <peers>.

/update

This allows you to notify the service that there are new changes that need to take effect.

/localclockdispersion:<in seconds>

This configures the Internal clock’s accuracy.

/reliable:<YES or NO>

This allows you to specify whether the system is a reliable source for time.

/largephaseoffset:<in milliseconds>

This lets you set the time difference involving your local and network time.

W32tm /dumpreg

To get information about a registry key, you can also go to the Command Prompt. There, enter the following, along with w32tm /dumpreg

/subkey:<key>

This shows you the values that are associated with the sub-key of the default key.

/computer:<name of the computer>

This shows you the queries registry settings for a specified computer.

W32tm /debug

The Command Prompt is also where you can access your computer’s private log. Here’s a short discussion of the parameters in this category.

/enable or /disable

This lets you enable or disable the private log. Because you want to access this log, enabling is the way to go.

/file:<name of your file>

This lets you specify the name of your file. In the example below, let’s say the name of our file is “xxx”.

/size:<size of your file>

This lets you specify the size of your file. What you should enter here is the maximum number of bytes.in the example, the size of our file is 100 bytes.

/entries:<number of entries>

This allows you to list down the value for your entries. The valid numbers for this field are in between 0 to 300. In the example, the value is 10.

Christopher Jan Benitez is a freelance writer for hire who provides actionable and useful web content to small businesses and startups. In his spare time, he religiously watches professional wrestling and finds solace in listening to ’80s speed metal. Read Christopher’s Full Bio

How to find time server in a domain?

In a Windows domain PDC isn’t necessarily the domain time server. How could I identify the authoritative time server?

4 Answers 4

I’m assuming that you’re looking for the server used by the W32Time service to perform time sync on domain-member computers.

In a stock Active Directory deployment the only computer configured with a time server explicitly will be computer holding the PDC Emulator FSMO role in the forest root domain. All domain controllers in the forest root domain synchronize time with the PDC Emulator FSMO role-holder. All PDC Emulator FSMO role-holders in child domains synchronize their time with domain controllers in their parent domain (including, potentially, the PDF Emulator FSMO role-holder in the forest root domain). All domain member computers synchronize time with domain controller computers in their respective domains.

To determine if a domain member is configured for domain time sync, examine the REG_SZ value at HKLM\System\CurrentControlSet\Services\W32Time\Parameters\Type. If it is set to «Nt5DS» then the computer is synchronizing time with the Active Directory time hierarchy. If it’s configured with the value «NTP» then the comptuer is synchronizing time with the NTP server specified in the NtpServer REG_SZ value in the same registry key.

The low-level details of the time synchronization protocol are available in this article: How Windows Time Service Works

Beware that not every domain controller (the KDC’s, as James directs you in finding via DNS in his post) may be running a time service. In a stock AD deployment every domain controller will be, but some deployments may use virtualized domain controllers that have the W32Time service disabled (to facilitate hypervisor-based time synchronization) and, as such, you would probably do well to implement functionality as described by the «How Windows Time Service Works» article if you’re developing a piece of software that needs to synchronize time in the same manner that a domain member computer would.

How can I query an NTP server under Windows?

I am not interested in synchronizing my local clock with the remote server. I only want to query it and print the result.

I would have assumed that there is a port of ntpq for Windows, but was unable to find any.

All other NTP clients I could find, they always want to install themselves as a service or make it otherwise clear that they want to synchronize my local time.

3 Answers 3

Wireshark shows NTP packets being generated by this. Some versions of w32tm have a /query option

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Капельница от запоя — облегчение за 15–20 минут