Installing and Administering Internet Services

228 Chapter 7
Configuring NTP
Querying xntpd
Querying xntpd
ntpq is a program used to query systems that are running xntpd about
the current state of the server. It can also be used to obtain a list of a
server’s peers. ntpq sends requests to and receives responses from NTP
time servers using a special form of NTP messages called mode-6
control messages. The program can be run either interactively or from
a command line. See the ntpq man page for details about using this
program.
ntpq is most useful for querying remote NTP implementations to assess
their timekeeping accuracy and to expose problems in configuration or
operation.
NOTE When you specify time-related configuration options in /etc/ntp.conf,
you specify the values in seconds. ntpq, however, displays time values in
milliseconds, as specified by the RFC 1305 NTP standard.
Use ntpq to verify the following:
xntpd can form associations with other NTP hosts.
Synchronization is taking place correctly.
After xntpd starts, run the ntpq program with the -p option:
/usr/sbin/ntpq -p
The -p option prints a list of NTP hosts known to the server, along with a
summary of their states. After a while, a display like the following
appears:
Figure 7-11 ntpg Output Showing Known NTP Hosts
The remote column shows hosts specified in the local host’s
configuration file plus other hosts that are configured to be peers with
the local host. The host address preceded with a ‘*’ indicates the current
remote refid st when poll reach delay offset disp
=======================================================================
+node1 node3 2 131 256 373 9.89 16.28 23.25
*server1 .WWVB. 1 137 256 377 280.62 21.74 20.23
-node2 node4 2 49 128 376 294.14 5.94 17.47
+server2 .WWVB. 1 173 256 377 279.95 20.56 16.40