1.\" $OpenBSD: ntpd.conf.5,v 1.22 2009/05/18 20:08:24 stevesk Exp $ 2.\" 3.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER IN 14.\" AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 15.\" OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: May 18 2009 $ 18.Dt NTPD.CONF 5 19.Os 20.Sh NAME 21.Nm ntpd.conf 22.Nd Network Time Protocol daemon configuration file 23.Sh DESCRIPTION 24This manual page describes the format of the 25.Xr ntpd 8 26configuration file. 27.Pp 28.Nm 29has the following format: 30.Pp 31Empty lines and lines beginning with the 32.Sq # 33character are ignored. 34.Pp 35Keywords may be specified multiple times within the configuration file. 36They are as follows: 37.Bl -tag -width Ds 38.It Ic listen on Ar address 39Specify a local IP address or a hostname the 40.Xr ntpd 8 41daemon should listen on. 42If it appears multiple times, 43.Xr ntpd 8 44will listen on each given address. 45If 46.Sq * 47is given as an address, 48.Xr ntpd 8 49will listen on all local addresses. 50.Xr ntpd 8 51does not listen on any address by default. 52For example: 53.Bd -literal -offset indent 54listen on * 55.Ed 56.Pp 57or 58.Bd -literal -offset indent 59listen on 127.0.0.1 60listen on ::1 61.Ed 62.It Xo Ic sensor Ar device 63.Op Ic correction Ar microseconds 64.Op Ic weight Ar weight-value 65.Op Ic refid Ar string 66.Xc 67Specify a timedelta sensor device 68.Xr ntpd 8 69should use. 70The sensor can be specified multiple times: 71.Xr ntpd 8 72will use each given sensor that actually exists. 73Non-existent sensors are ignored. 74If 75.Sq * 76is given as device name, 77.Xr ntpd 8 78will use all timedelta sensors it finds. 79.Xr ntpd 8 80does not use any timedelta sensor by default. 81For example: 82.Bd -literal -offset indent 83sensor * 84sensor nmea0 85.Ed 86.Pp 87An optional correction in microseconds can be given to compensate 88for the sensor's offset. 89The maximum correction is 127 seconds. 90For example, if a DCF77 receiver is lagging 70ms behind 91actual time: 92.Bd -literal -offset indent 93sensor udcf0 correction 70000 94.Ed 95.Pp 96The optional 97.Ic weight 98keyword permits finer control over the relative importance 99of time sources (servers or sensor devices). 100Weights are specified in the range 1 to 10; 101if no weight is given, 102the default is 1. 103A server with a weight of 5, for example, 104will have five times more influence on time offset calculation 105than a server with a weight of 1. 106.Pp 107An optional reference ID string - up to 4 ASCII characters - can be 108given to publish the sensor type to clients. 109RFC 2030 suggests some common reference identifiers, but new identifiers 110"can be contrived as appropriate." 111If an ID string is not given, 112.Xr ntpd 8 113will use a generic reference ID. 114For example: 115.Bd -literal -offset indent 116sensor nmea0 refid GPS 117.Ed 118.It Xo Ic server Ar address 119.Op Ic weight Ar weight-value 120.Xc 121Specify the IP address or the hostname of an NTP 122server to synchronize to. 123If it appears multiple times, 124.Xr ntpd 8 125will try to synchronize to all of the servers specified. 126If a hostname resolves to multiple IPv4 and/or IPv6 addresses, 127.Xr ntpd 8 128uses the first address. 129If it does not get a reply, 130.Xr ntpd 8 131retries with the next address and continues to do so until a working address 132is found. 133For example: 134.Bd -literal -offset indent 135server 10.0.0.2 weight 5 136server ntp.example.org weight 1 137.Ed 138.Pp 139To provide redundancy, it is good practice to configure multiple servers. 140In general, best accuracy is obtained by using servers that have a low 141network latency. 142.It Xo Ic servers Ar address 143.Op Ic weight Ar weight-value 144.Xc 145As with 146.Cm server , 147specify the IP address or hostname of an NTP server to synchronize to. 148If it appears multiple times, 149.Xr ntpd 8 150will try to synchronize to all of the servers specified. 151Should the hostname resolve to multiple IP addresses, 152.Xr ntpd 8 153will try to synchronize to all of them. 154For example: 155.Bd -literal -offset indent 156servers pool.ntp.org 157.Ed 158.El 159.Sh FILES 160.Bl -tag -width "/etc/ntpd.confXXX" -compact 161.It Pa /etc/ntpd.conf 162default 163.Xr ntpd 8 164configuration file 165.El 166.Sh SEE ALSO 167.Xr ntpd 8 , 168.Xr sysctl 8 169.Sh HISTORY 170The 171.Nm 172file format first appeared in 173.Ox 3.6 . 174