Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Querying the NTP status with internal commands of ntpq

&pagelevel(5)&pagelevel

The following commands are executed by the ntpq program itself.


Show information on command keywords


?[ keyword]


A “?” on its own outputs a list of all the command keywords known to ntpq. A “?” followed by a command keyword provides information on the function and syntax of the command.


Specify a time limit for answers to server queries


timeout milliseconds


The timeout command specifies a timeout for answers to server queries (in milliseconds). Since ntpq repeats each query on exceeding the timeout, the total waiting period is twice the length of the specified timeout.
Default: 5000 milliseconds.


Specify host name for subsequent queries


host hostname


The host command specifies the host to which subsequent queries are to be sent. The hostname can be specified as either a computer name or a numerical address.


Show host names with ntpq output


hostnames yes | hostnames no


If hostname yes is specified, the host names are shown in the ntpq output. If hostname no is specified, numerical addresses are shown instead of the host names.

Default: hostname yes (unless changed with the -n switch in the command line).


Show unformatted answers of the remote server


raw


The answers of the remote server to the query commands are shown as received. The only formatting/interpretation carried out on the data is the conversion of non-ASCII data to a readable format.


Show formatted answers to query commands


cooked


The answers to the query commands are interpreted, and the values of the variables recognized by the server are converted to a user-friendly format. Variables that cannot be interpreted by ntpq are identified with a “?”.


Set version number


ntpversion 1 | ntpversion 2 | ntpversion 3 | ntpversion 4


Sets the version number to be used by ntpq in NTP packets. Please note that mode 6 control messages (and, of course, the corresponding mode) do not exist in versions prior to NTPVersion 2.
Default: ntpversion 2


Enable debugging function


debug more | debug less | debug off


Enables or disables the internal debugging function of the query command.

debug more

Increments the debug level by 1, thus returning more diagnostic information.

debug less

Reduces the debug level by 1, thus returning less diagnostic information.

debug off

Turns off the debugging function.


Exits ntpq


quit


Exits the ntpq program.