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

от admin

Как проверить синхронизацию времени в Windows

Правильней использовать термин "Служба времени Windows" вместо NTP, но к сожалению из-за слишком долгой работы с разными юниксами мне очень сложно перестроиться. Надеюсь опытные пользователи Microsoft или MVP не будут писать гневные комментарии. MCSA или MCSE я думаю сюда и не заглянут — они и так всё знают ��

Win + R → cmd → Enter

Формат команды для проверки доступности NTP сервера

Проверим сервер time.windows.com

Я могу ошибаться, но похоже Windows Server не разрешает устанавливать несколько NTP серверов через GUI .

К счастью я нашёл отличный .bat'ник на github

Обычно я использую для синхронизации time.cloudflare.com time.google.com time.windows.com ntp.ripe.net или ntp.ripe.net ntp.nic.cz ntp.time.nl time.google.com .

Для наглядности я ввёл все команды из примера выше вручную

Теперь можно посмотреть список наших NTP серверов (/peers: отображение списка узлов и их состояние)

Посмотреть статус синхронизации с NTP (/status: отображение состояния службы времени Windows)

Посмотреть конфигурацию NTP (/configuration: отображение конфигурации времени выполнения и места, где берется параметр).

Как найти 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 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.

Читать:
Teamviewer как отключить автозапуск

How can I check a system's current NTP configuration?

I need to verify the current NTP configuration on some Windows systems. Ideally, I’d like to be able to do this via command line instead of navigating through configuration screens.

(I’m working on several different OS versions, and configuration screens tend to not always be in the same place across versions.)

I’m hoping to find a quick, memorable command that I can just punch into a CMD console to get the result. A batch file I can carry around with me will do just as well, though.

Specifically, I need the following:

  • Show whether or not the system is configured to receive time from an NTP server.
  • Show the NTP server(s) the system is receiving time from.
  • Show the time of the last synchronization.
  • Show the current time on the system.

What command(s) would be necessary to achieve these results?

Looking for a solution that’s cross-compatible with Windows XP, 7, Server 2003, and Server 2008.

fixer1234's user avatar

6 Answers 6

In the command line, type

w32tm /query /configuration gives you the configuration you have set up.

w32tm /query /status gives you information such as:

  • stratum
  • leap indicator
  • precision
  • last sync
  • NTP server
  • poll interval

time /T outputs the current system time.

Note: w32tm /query was first made available in the Windows Time client versions of Windows Vista, and Windows Server 2008. See Windows Time Service Tools and Settings

This answers your last question:

Open a command prompt and type exactly:

w32tm /stripchart /computer:NTPServerNameOrIP /dataonly /samples:x (how many returns you want)

It returns time and difference to NTP server time. If it returns time, error: 0x80072746 then that is not your NTP server.

An example of a command is below:

Command example

In a different machine, I got:

In another machine, I got the help page, saying also:

So, basically, the service was not running. Following these instructions, I did:

Finally, all the above would work. (note: if net start fails, see below) Then I just needed to set my ntp up. I did it with:

following instructions from here, but perhaps it could’ve been as easy as:

as instructed here. (10.0.0.5 being my local NTP server). If you’re not using a local NTP server, you can use the generic one:

Finally, you might need to do the following, which was not necessary for me:

NOTE: if net start w32time fails with error 1290 (The service start failed since one or more services in the same process have an incompatible service SID type setting) then follow the steps here:

Then follow as above.

NOTE 2: if the NTP service doesn’t automatically start on reboot, it might be due to its start settings, as described here: depending on your windows, it might be set to start only when it joins a domain. You can check with:

If it’s configured to start when you join a domain, and you don’t have a domain set up in your machine, it will not start the service and set the time. It probably doesn’t join a domain because you don’t want it to. In any case, just change which trigger starts it. For example, to start when the machine has network (and therefore is able to access the server), do:

Похожие статьи