NTP name resolution
The xntpd daemon can specify host names
requiring resolution in peer and server statements
in the configuration file.
This task is actually accomplished by a separate program, xntpres.
When the daemon comes across a peer or server statement
in the configuration file where the host is identified by name
rather than by IP address, it records the relevant information
and continues.
When the end of the configuration file has been reached and one or more
entries requiring name resolution have been found,
xntpres is started.
The xntpd daemon continues running at the same time to
process those hosts with numeric addresses.
The xntpres program attempts to resolve each host name, meaning that it tries to obtain the IP address associated with the named host. If it succeeds in resolving the name, it reconfigures the local host to add the newly resolved host to the list of time servers to be polled. The runtime reconfiguration of the local host is accomplished using the same mode 7 runtime reconfiguration facility that xntpdc uses. If xntpres is at first unable to resolve a hostname, it retries periodically until it succeeds or until it determines that the name cannot be resolved.
There are several configuration requirements if xntpres is to be used. The pathname of the xntpres program must be made known to the daemon with the resolver statement in the configuration file. Also, mode 7 runtime reconfiguration must be enabled with the requestkey statement and a list of valid keys (valid keys are specified in the keys file).
The following fragment might be added to /etc/ntp.conf to accomplish this:
resolver /etc/xntpres keys /etc/ntp.keys requestkey 65535Note that xntpres sends packets to the server with a source address of 127.0.0.1. If you are using the address-and-mask facility in the configuration file, you must take care not to restrict modification requests from this address or xntpres fails.