19c2daa00SOllivier Robert<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 29c2daa00SOllivier Robert<html> 39c2daa00SOllivier Robert<head> 4ea906c41SOllivier Robert<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"> 59c2daa00SOllivier Robert<meta name="generator" content="HTML Tidy, see www.w3.org"> 69c2daa00SOllivier Robert<title>ntpd - Network Time Protocol (NTP) daemon</title> 7*2b15cb3dSCy Schubert<!-- Changed by: Harlan &, 10-Feb-2014 --> 89c2daa00SOllivier Robert<link href="scripts/style.css" type="text/css" rel="stylesheet"> 99c2daa00SOllivier Robert</head> 109c2daa00SOllivier Robert<body> 11*2b15cb3dSCy Schubert<h3><tt>ntpd</tt> - Network Time Protocol (NTP) Daemon</h3> 12*2b15cb3dSCy Schubert<img src="pic/wingdorothy.gif" alt="gif" align="left"><a href="http://www.eecis.udel.edu/~mills/pictures.html">from <i>The Wizard of Oz</i>, L. Frank Baum</a> 13*2b15cb3dSCy Schubert<p>You need help from the monkeys.</p> 14*2b15cb3dSCy Schubert<p>Last update: 15*2b15cb3dSCy Schubert <!-- #BeginDate format:En2m -->10-Mar-2014 05:14<!-- #EndDate --> 16*2b15cb3dSCy Schubert UTC</p> 179c2daa00SOllivier Robert<br clear="left"> 189c2daa00SOllivier Robert<h4>Related Links</h4> 19*2b15cb3dSCy Schubert<script type="text/javascript" language="javascript" src="scripts/command.txt"></script> 209c2daa00SOllivier Robert<h4>Table of Contents</h4> 219c2daa00SOllivier Robert<ul> 22*2b15cb3dSCy Schubert <li class="inline"><a href="#synop">Synopsis</a></li> 23*2b15cb3dSCy Schubert <li class="inline"><a href="#descr">Description</a></li> 24*2b15cb3dSCy Schubert <li class="inline"><a href="#cmd">Command Line Options</a></li> 25*2b15cb3dSCy Schubert <li class="inline"><a href="#cfg">The Configuration File</a></li> 26*2b15cb3dSCy Schubert <li class="inline"><a href="#files">Files</a></li> 279c2daa00SOllivier Robert</ul> 289c2daa00SOllivier Robert<hr> 299c2daa00SOllivier Robert<h4 id="synop">Synopsis</h4> 30*2b15cb3dSCy Schubert<tt>ntpd [ -46aAbdDgLmnNqx ] [ -c <i>conffile</i> ] [ -f <i>driftfile</i> ] [ -i <i>jaildir</i> ] [ -I <i>InterfaceOrAddress</i> ] [ -k <i>keyfile</i> ] [ -l <i>logfile</i> ] [ -p <i>pidfile</i> ] [ -P <i>priority</i> ] [ -r <i>broadcastdelay</i> ] [ -s <i>statsdir</i> ] [ -t <i>key</i> ] [ -u <i>user</i>[:<i>group</i>] ] [ -U <i>interface_update_interval</i> ] [ -v <i>variable</i> ] [ -V <i>variable</i> ]</tt> 319c2daa00SOllivier Robert<h4 id="descr">Description</h4> 32*2b15cb3dSCy Schubert<p>The <tt>ntpd</tt> program is an operating system daemon that synchronizes the system clock to remote NTP time servers or local reference clocks. It is a complete implementation of NTP version 4 defined by RFC-5905, but also retains compatible with version 3 defined by RFC-1305 and versions 1 and 2, defined by RFC-1059 and RFC-1119, respectively. The program can operate in any of several modes, including client/server, symmetric and broadcast modes, and with both symmetric-key and public key-cryptography</p> 33*2b15cb3dSCy Schubert<p>The <tt>ntpd</tt> program ordinarily requires a configuration file described on this page. It contains configuration commands described on the pages listed above. However a client can discover remote servers and configure them automatically. This makes it possible to deploy a fleet of workstations without specifying configuration details specific to the local environment. Further details are on the </p> 34*2b15cb3dSCy Schubert<p>The <tt>ntpd</tt> program normally operates continuously while adjusting the system time and frequency, but in some cases this might not be practical. With the <tt>-q</tt> option <tt>ntpd</tt> operates as in continuous mode, but exits just after setting the clock for the first time. Most applications will probably want to specify the <tt>iburst</tt> option with the <tt>server</tt> command. With this option a volley of messages is exchanged to groom the data and set the clock in about ten seconds. If nothing is heard after a few minutes, the daemon times out and exits without setting the clock.</p> 359c2daa00SOllivier Robert<h4 id="cmd">Command Line Options</h4> 369c2daa00SOllivier Robert<dl> 37*2b15cb3dSCy Schubert <dt><tt>-4</tt> 38*2b15cb3dSCy Schubert <dd>Force DNS resolution of host names to the IPv4 namespace. 39*2b15cb3dSCy Schubert <dt><tt>-6</tt> 40*2b15cb3dSCy Schubert <dd>Force DNS resolution of host names to the IPv6 namespace. 41*2b15cb3dSCy Schubert <dt><tt>-a</tt></dt> 42*2b15cb3dSCy Schubert <dd>Require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>enable auth</tt> command and is the default.</dd> 43*2b15cb3dSCy Schubert <dt><tt>-A</tt></dt> 44*2b15cb3dSCy Schubert <dd>Do not require cryptographic authentication for broadcast client, multicast client and symmetric passive associations. This is the same operation as the <tt>disable auth</tt> command and almost never a good idea.</dd> 45*2b15cb3dSCy Schubert <dt><tt>-b</tt></dt> 46*2b15cb3dSCy Schubert <dd>Enable the client to synchronize to broadcast servers.</dd> 47*2b15cb3dSCy Schubert <dt><tt>-c <i>conffile</i></tt></dt> 48*2b15cb3dSCy Schubert <dd>Specify the name and path of the configuration file. Without the option the default is <tt>/etc/ntp.conf</tt>.</dd> 49*2b15cb3dSCy Schubert <dt><tt>-d</tt></dt> 50*2b15cb3dSCy Schubert <dd> Disable switching into daemon mode, so <tt>ntpd</tt> stays attached to the starting terminal which will get all the debugging printout. Also, ^C will kill it. This option may occur more than once, with each occurrence indicating greater detail of display.</dd> 51*2b15cb3dSCy Schubert <dt><tt>-D <i>level</i></tt></dt> 52*2b15cb3dSCy Schubert <dd>Specify debugging level directly, with <tt>level</tt> corresponding to the numbe of <tt>-d</tt> options..</dd> 53*2b15cb3dSCy Schubert <dt><tt>-f <i>driftfile</i></tt></dt> 54*2b15cb3dSCy Schubert <dd>Specify the name and path of the frequency file. This is the same operation as the <tt>driftfile <i>driftfile</i></tt> configuration command. 55*2b15cb3dSCy Schubert <dt><tt>-g</tt></dt> 56*2b15cb3dSCy Schubert <dd>Normally, <tt>ntpd</tt> exits with a message to the system log if the offset exceeds the panic threshold, which is 1000 s by default. This option allows the time to be set to any value without restriction; however, this can happen only once. If the threshold is exceeded after that, <tt>ntpd</tt> will exit with a message to the system log. This option can be used with the <tt>-q</tt> and <tt>-x</tt> options. See the <tt>tinker</tt> command for other options.</dd> 57*2b15cb3dSCy Schubert <dt><tt>-i <i>jaildir</i></tt></dt> 58*2b15cb3dSCy Schubert <dd>Chroot the server to the directory <i><tt>jaildir</tt></i>. This option also implies that the server attempts to drop root privileges at startup (otherwise, chroot gives very little additional security), and it is only available if the OS supports to run the server without full root privileges. You may need to also specify a <tt>-u</tt> option.</dd> 59*2b15cb3dSCy Schubert <dt id="--interface"><tt>-I [<i>address</i> | <i>interface name</i>]</tt></dt> 60*2b15cb3dSCy Schubert <dd>Open the network address given, or all the addresses associated with the given interface name. This option may appear multiple times. This option also implies not opening other addresses, except wildcard and localhost. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.</dd> 61*2b15cb3dSCy Schubert <dt><tt>-k <i>keyfile</i></tt></dt> 62*2b15cb3dSCy Schubert <dd>Specify the name and path of the symmetric key file. This is the same operation as the <tt>keys <i>keyfile</i></tt> command.</dd> 63*2b15cb3dSCy Schubert <dt><tt>-l <i>logfile</i></tt></dt> 64*2b15cb3dSCy Schubert <dd>Specify the name and path of the log file. The default is the system log file. This is the same operation as the <tt>logfile <i>logfile</i></tt> command.</dd> 65*2b15cb3dSCy Schubert <dt id="--mdns"><tt>-m</tt></dt> 66*2b15cb3dSCy Schubert <dd>Once the system clock is synchronized, register with mDNS as an available server.</dd> 67*2b15cb3dSCy Schubert <dt id="--novirtualips"><tt>-L</tt></dt> 68*2b15cb3dSCy Schubert <dd>Do not listen to virtual interfaces, defined as those with names containing a colon. This option is deprecated. Please consider using the configuration file <a href="miscopt.html#interface">interface</a> command, which is more versatile.</dd> 69*2b15cb3dSCy Schubert <dt><tt>-M</tt></dt> 70*2b15cb3dSCy Schubert <dd>Raise scheduler precision to its maximum (1 ms) using timeBeginPeriod. (Windows only)</dd> 71*2b15cb3dSCy Schubert <dt><tt>-n</tt></dt> 72*2b15cb3dSCy Schubert <dd>Don't fork.</dd> 73*2b15cb3dSCy Schubert <dt><tt>-N</tt></dt> 74*2b15cb3dSCy Schubert <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the highest priority.</dd> 75*2b15cb3dSCy Schubert <dt><tt>-p <i>pidfile</i></tt></dt> 76*2b15cb3dSCy Schubert <dd>Specify the name and path of the file used to record the <tt>ntpd</tt> process ID. This is the same operation as the <tt>pidfile <i>pidfile</i></tt> command.</dd> 77*2b15cb3dSCy Schubert <dt><tt>-P <i>priority</i></tt></dt> 78*2b15cb3dSCy Schubert <dd>To the extent permitted by the operating system, run the <tt>ntpd</tt> at the specified priority.</dd> 79*2b15cb3dSCy Schubert <dt><tt>-q</tt></dt> 80*2b15cb3dSCy Schubert <dd>Exit the <tt>ntpd</tt> just after the first time the clock is set. This behavior mimics that of the <tt>ntpdate</tt> program, which is to be retired. The <tt>-g</tt> and <tt>-x</tt> options can be used with this option. Note: The kernel time discipline is disabled with this option.</dd> 81*2b15cb3dSCy Schubert <dt><tt>-r <i>broadcastdelay</i></tt></dt> 82*2b15cb3dSCy Schubert <dd>Specify the default propagation delay from the broadcast/multicast server to this client. This is necessary only if the delay cannot be computed automatically by the protocol.</dd> 83*2b15cb3dSCy Schubert <dt><tt>-s <i>statsdir</i></tt></dt> 84*2b15cb3dSCy Schubert <dd>Specify the directory path for files created by the statistics facility. This is the same operation as the <tt>statsdir <i>statsdir</i></tt> command.</dd> 85*2b15cb3dSCy Schubert <dt><tt>-t <i>key</i></tt></dt> 86*2b15cb3dSCy Schubert <dd>Add a key number to the trusted key list. This option can occur more than once. This is the same operation as the <tt>trustedkey <i>key</i></tt> command.</dd> 87*2b15cb3dSCy Schubert <dt><tt>-u <i>user[:group]</i> </tt></dt> 88*2b15cb3dSCy Schubert <dd>Specify a user, and optionally a group, to switch to. This option is only available if the OS supports running the server without full root privileges. Currently, this option is supported under NetBSD (configure with <tt>--enable-clockctl</tt>) and Linux (configure with --<tt>enable-linuxcaps</tt>).</dd> 89*2b15cb3dSCy Schubert <dt><tt>-U <i>interface update interval</i></tt></dt> 90*2b15cb3dSCy Schubert <dd>Number of seconds to wait between interface list scans to pick up old and delete network interface. Set to 0 to disable dynamic interface list updating. The default is to scan every 5 minutes.</dd> 91*2b15cb3dSCy Schubert <dt><tt>-v <i>variable</i></tt><br> 92*2b15cb3dSCy Schubert <tt>-V <i>variable</i></tt></dt> 93*2b15cb3dSCy Schubert <dd>Add a system variable listed by default.</dd> 94*2b15cb3dSCy Schubert <dt><tt>-x</tt></dt> 95*2b15cb3dSCy Schubert <dd>Normally, the time is slewed if the offset is less than the step threshold, which is 128 ms by default, and stepped if above the threshold. This option sets the threshold to 600 s, which is well within the accuracy window to set the clock manually. Note: Since the slew rate of typical Unix kernels is limited to 0.5 ms/s, each second of adjustment requires an amortization interval of 2000 s. Thus, an adjustment as much as 600 s will take almost 14 days to complete. This option can be used with the <tt>-g</tt> and <tt>-q</tt> options. See the <tt>tinker</tt> command for other options. Note: The kernel time discipline is disabled with this option.</dd> 96*2b15cb3dSCy Schubert <dt><tt>--pccfreq <i>frequency</i></tt></dt> 97*2b15cb3dSCy Schubert <dd>Substitute processor cycle counter for QueryPerformanceCounter unconditionally 98*2b15cb3dSCy Schubert using the given frequency (in Hz). <tt>--pccfreq</tt> can be used on systems 99*2b15cb3dSCy Schubert which do not use the PCC to implement QueryPerformanceCounter 100*2b15cb3dSCy Schubert and have a fixed PCC frequency. The frequency specified must 101*2b15cb3dSCy Schubert be accurate within 0.5 percent. <tt>--usepcc</tt> is equivalent on many systems and should 102*2b15cb3dSCy Schubert be tried first, as it does not require determining the frequency 103*2b15cb3dSCy Schubert of the processor cycle counter. For x86-compatible processors, the PCC is 104*2b15cb3dSCy Schubert also referred to as <tt>RDTSC</tt>, which is the assembly-language instruction to retrieve 105*2b15cb3dSCy Schubert the current value. (Windows only)</dd> 106*2b15cb3dSCy Schubert <dt><tt>--usepcc</tt></dt> 107*2b15cb3dSCy Schubert <dd>Substitute processor cycle counter for QueryPerformanceCounter if they 108*2b15cb3dSCy Schubert appear equivalent. This option should be used only if the PCC 109*2b15cb3dSCy Schubert frequency is fixed. Power-saving functionality on many laptops varies the 110*2b15cb3dSCy Schubert PCC frequency. (Windows only)</dd> 1119c2daa00SOllivier Robert</dl> 1129c2daa00SOllivier Robert<h4 id="cfg">The Configuration File</h4> 113*2b15cb3dSCy Schubert<p>Ordinarily, <tt>ntpd</tt> reads the <tt>ntp.conf</tt> configuration file at startup in order to determine the synchronization sources and operating modes. It is also possible to specify a working, although limited, configuration entirely on the command line, obviating the need for a configuration file. This may be particularly useful when the local host is to be configured as a broadcast client, with servers determined by listening to broadcasts at run time.</p> 114*2b15cb3dSCy Schubert<p>Usually, the configuration file is installed as<tt>/etc/ntp.conf</tt>, but could be installed elsewhere (see the <tt>-c <i>conffile</i></tt> command line option). The file format is similar to other Unix configuration files - comments begin with a <tt>#</tt> character and extend to the end of the line; blank lines are ignored.</p> 115*2b15cb3dSCy Schubert<p>Configuration commands consist of an initial command keyword followed by a list of option keywords separated by whitespace. Commands may not be continued over multiple lines. Options may be host names, host addresses written in numeric, dotted-quad form, integers, floating point numbers (when specifying times in seconds) and text strings. Optional arguments are delimited by <tt>[ ]</tt> in the options pages, while alternatives are separated by <tt>|</tt>. The notation <tt>[ ... ]</tt> means an optional, indefinite repetition of the last item before the <tt>[ ... ]</tt>.</p> 1169c2daa00SOllivier Robert<h4 id="files">Files</h4> 117ea906c41SOllivier Robert<table width="100%" border="1"> 1189c2daa00SOllivier Robert <tr> 1199c2daa00SOllivier Robert <td width="30%">File</td> 1209c2daa00SOllivier Robert <td width="30%">Default</td> 1219c2daa00SOllivier Robert <td width="20%">Option</td> 122*2b15cb3dSCy Schubert <td width="20%">Option</td> 1239c2daa00SOllivier Robert </tr> 1249c2daa00SOllivier Robert <tr> 1259c2daa00SOllivier Robert <td width="30%">configuration file</td> 1269c2daa00SOllivier Robert <td width="30%"><tt>/etc/ntp.conf</tt></td> 1279c2daa00SOllivier Robert <td width="20%"><tt>-c</tt></td> 128*2b15cb3dSCy Schubert <td width="20%"><tt>conffile</tt></td> 1299c2daa00SOllivier Robert </tr> 1309c2daa00SOllivier Robert <tr> 1319c2daa00SOllivier Robert <td width="30%">frequency file</td> 132*2b15cb3dSCy Schubert <td width="30%">none</td> 1339c2daa00SOllivier Robert <td width="20%"><tt>-f</tt></td> 1349c2daa00SOllivier Robert <td width="20%"><tt>driftfile</tt></td> 1359c2daa00SOllivier Robert </tr> 1369c2daa00SOllivier Robert <tr> 137*2b15cb3dSCy Schubert <td width="30%">leapseconds file</td> 138*2b15cb3dSCy Schubert <td width="30%">none</td> 139*2b15cb3dSCy Schubert <td width="20%"></td> 140*2b15cb3dSCy Schubert <td width="20%"><tt>leapfile</tt></td> 141*2b15cb3dSCy Schubert </tr> 142*2b15cb3dSCy Schubert <tr> 1439c2daa00SOllivier Robert <td width="30%">process ID file</td> 1449c2daa00SOllivier Robert <td width="30%">none</td> 1459c2daa00SOllivier Robert <td width="20%"><tt>-p</tt></td> 1469c2daa00SOllivier Robert <td width="20%"><tt>pidfile</tt></td> 1479c2daa00SOllivier Robert </tr> 1489c2daa00SOllivier Robert <tr> 1499c2daa00SOllivier Robert <td width="30%">log file</td> 1509c2daa00SOllivier Robert <td width="30%">system log</td> 1519c2daa00SOllivier Robert <td width="20%"><tt>-l</tt></td> 1529c2daa00SOllivier Robert <td width="20%"><tt>logfile</tt></td> 1539c2daa00SOllivier Robert </tr> 1549c2daa00SOllivier Robert <tr> 1559c2daa00SOllivier Robert <td width="30%">include file</td> 1569c2daa00SOllivier Robert <td width="30%">none</td> 1579c2daa00SOllivier Robert <td width="20%">none</td> 1589c2daa00SOllivier Robert <td width="20%"><tt>includefile</tt></td> 1599c2daa00SOllivier Robert </tr> 1609c2daa00SOllivier Robert <tr> 1619c2daa00SOllivier Robert <td width="30%">statistics path</td> 1629c2daa00SOllivier Robert <td width="30%"><tt>/var/NTP</tt></td> 1639c2daa00SOllivier Robert <td width="20%"><tt>-s</tt></td> 1649c2daa00SOllivier Robert <td width="20%"><tt>statsdir</tt></td> 1659c2daa00SOllivier Robert </tr> 1669c2daa00SOllivier Robert <tr> 1679c2daa00SOllivier Robert <td width="30%">keys path</td> 1689c2daa00SOllivier Robert <td width="30%"><tt>/usr/local/etc</tt></td> 169*2b15cb3dSCy Schubert <td width="20%">none</td> 1709c2daa00SOllivier Robert <td width="20%"><tt>keysdir</tt></td> 1719c2daa00SOllivier Robert </tr> 1729c2daa00SOllivier Robert</table> 1739c2daa00SOllivier Robert<hr> 1749c2daa00SOllivier Robert<script type="text/javascript" language="javascript" src="scripts/footer.txt"></script> 1759c2daa00SOllivier Robert</body> 1769c2daa00SOllivier Robert</html> 177