ntpd keeps adding local servers while being told not to
After some debugging and Aaron
's help, I've found the problem.
The ISC DHCP client fetches ntp servers information by default in Debian.
Debian's ntpd
init script makes it use that info, by extending /etc/ntp.conf
with it. The resulting file is made available at /var/lib/ntp/ntp.conf.dhcp
.
The solution is, of course, properly configuring DHCP not to receive ntp servers (just remove the ntp-servers
option in /etc/dhcp/dhclient.conf
).
More information available in NTP's support page, section 6.12:
ISC's dhcp is able to automatically configure the servers used by ntpd.
Here's how to get it working:
The dhcp server you are using must be configured to provide
the ntp-servers option
Configure your dhclient to request ntp-servers (it doesn't by default).
To do this add ntp-servers to the default request line in
/etc/dhcp3/dhclient.conf
Create an /etc/ntp.conf with all of the other settings that you wish to use.
This file will be used to create /etc/ntp.conf.dhcp, it won't be over written.
Your ntpd must be told to use /etc/ntp.conf.dhcp if it exists.
This is usually accomplished in the ntp init script (e.g. /etc/init.d/ntp).