ntp - query a clock running a Network Time Protocol daemon, either ntpd or xntpd
/usr/bin/ntp [-v] [-s] [-f] host1|IPaddress1 ...
Specifies verbose output. The output shows the full contents of the received NTP packets, plus the calculated offset and delay. Sets local clock to remote time. This only happens if the offset between the local and remote time is less than 1000 seconds. The local clock is not reset if the remote host is unsynchronized.
The ntp command may be retired in a future release; use the ntpdate(8) command instead.
The ntp command is used to determine the offset between the local clock and a remote clock. It can also be used to set the local host's time to a remote host's time. The ntp command sends an NTP packet to the NTP daemon running on each of the remote hosts specified on the command line. The remote hosts must be running either the ntpd daemon or xntpd daemon. When the NTP daemon on the remote host receives the NTP packet, it fills in the fields (as specified in RFC 1129), and sends the packet back. The ntp command then formats and prints the results on the standard output.
You can specify hosts by either host name or Internet address. The hosts that you specify must either exist in the /etc/hosts file, or in the master hosts database, if the database is being served to your system by BIND or Network Information Service (NIS).
The default output shows the roundtrip delay of the NTP packet in seconds, the estimated offset between the local time and remote time in seconds, and the date in ctime format. See the ctime(3) reference page for more information.
options can be used to
reset the time of the local clock.
that you be logged on as superuser.
The following error messages can be returned by NTP:
May indicate that the NTP daemon is not running on the remote
The NTP command cannot resolve the specified host name in
file. Check that the host exists in the
file, or that it exists in the master
database, if the database is being served to your system by BIND
The following is the default output to an ntp query about a remote host with an internet address of 5220.127.116.11: # /usr/bin/ntp 518.104.22.168 522.214.171.124: delay:1.845207 offset:-0.358460 Mon Aug 20 08:05:44 1991 The following is the verbose output to an ntp query about the same remote host: # /usr/bin/ntp -v 5126.96.36.199
Packet from: [5188.8.131.52] Leap 0, version 1, mode Server, poll 6, precision -10 stratum 1 (WWVB) Synch Distance is 0000.1999 0.099991 Synch Dispersion is 0000.0000 0.000000 Reference Timestamp is a7bea6c3.88b40000 Tue Aug 20 14:06:43 1991 Originate Timestamp is a7bea6d7.d7e6e652 Tue Aug 20 14:07:03 1991 Receive Timestamp is a7bea6d7.cf1a0000 Tue Aug 20 14:07:03 1991 Transmit Timestamp is a7bea6d8.0ccc0000 Tue Aug 20 14:07:04 1991 Input Timestamp is a7bea6d8.1a77e5ea Tue Aug 20 14:07:04 1991 5184.108.40.206: delay:0.019028 offset:-0.043890 Tue Aug 20 14:07:04 1991
ctime(3), ntp.conf(4), ntpdate(8), ntpdc(8), xntpd(8), xntpdc(8), ntpq(8)
Internet time synchronization: The Network Time Protocol (RFC 1129)