is there any option ntpq for the ntp server connectivity test like ntpdate -d command?

Is there any option ntpq for the ntp server connectivity test like the ntpdate -d command?

ntpdate -d ntpserverip

This command shows the suitable ntp server for synchronization. What the equivalent for the ntpq command?

ntpdate -d ntpserverip
adjust time server ntpserverip offset 0.101886 sec –> for success response

ntpdate -d ntpserverip
no server suitable for synchronization found –> for fail response

This ntpserverip is not in the ntp.conf. I want to test different a NTP server which is not in the ntp.conf.

Answer

If you’re missing the deprecated ntpdate, sntp is a better substitute than ntpq.

By default, sntpntpserverip will query the time without setting the clock (like options -q and -d of ntpdate did), using a random port (like options -u and -d of ntpdate did).

Optionally, include:

  • -4 or -6 to force IPv4 or IPv6 DNS resolution.
  • -d for debugging mode (may be repeated to increase level).
  • -r if you need to use NTP port 123 (if ntpd isn’t already using it).
  • -akeyid if you need MAC authentication.

See also:

Attribution
Source : Link , Question Author : arifisik , Answer Author : Picotin

Leave a Comment