Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Mar 2004 20:58:23 +0000
From:      "Stefan A. Deutscher" <sa.deutscher@tiscali.de>
To:        freebsd-questions@freebsd.org
Subject:   [Q] Another ntdp question: server?
Message-ID:  <20040321205823.C64884@tiscali.de>

next in thread | raw e-mail | index | archive | help
Howdy,

 having sort of clarified the location of the drift file I have come
across another ntpd thingy I cannot quite interpret:

# tail /var/log/messages | cut -c 7-
 18:28:41 dvorak ntpd[1192]: ntpd 4.1.1b-a Thu Jun  5 00:47:30 GMT 2003 (1)
 18:28:41 dvorak ntpd[1192]: kernel time discipline status 2040
 18:28:41 dvorak ntpd[1192]: getnetnum: "ntp1.ptb.de" invalid host number, line ignored
 18:28:41 dvorak ntpd[1192]: getnetnum: "ntp2.ptb.de" invalid host number, line ignored
 18:32:03 dvorak ntpd[1192]: time set -0.242122 s
 18:34:41 dvorak ntpd[1192]: ntpd exiting on signal 3
 18:35:26 dvorak ntpd[1261]: ntpd 4.1.1b-a Thu Jun  5 00:47:30 GMT 2003 (1)
 18:35:26 dvorak ntpd[1261]: kernel time discipline status 2040
 18:35:26 dvorak ntpd[1261]: getnetnum: "ntp1.ptb.de" invalid host number, line ignored
 18:35:26 dvorak ntpd[1261]: getnetnum: "ntp2.ptb.de" invalid host number, line ignored
 18:48:24 dvorak ntpd[1261]: time set -0.079761 s

So, what I do not quite understand is why 
(a) it ignores the time server name, 
(b) still sets the time
(c) never again complains about the host until quit and restarted


Oddly enough, the time server is found via a nslookup, and it works when
given to ntpd (or ntpdate, for that matter) on the command line.

# nslookup ntp1.ptb.de
 Server:  cache1.tiscali.de
 Address:  195.185.185.195
 Non-authoritative answer:
 Name:    ntp1.ptb.de
 Address:  192.53.103.103


'man ntp.conf' seems to indicate that IP address or machine name are
allowed, and that there is some flag to enable name resolution (which I
did not find):

 [ ... snip ... ]

 server address [key key | autokey] [burst] [iburst] [version version]
        [prefer] [minpoll minpoll] [maxpoll maxpoll]

 [ ... snip ... ]

 These four commands specify the time server name or address to be used
 and the mode in which to operate.  The address can be either a DNS name
 or an IP address in dotted-quad notation.

 [ ... snip ... ]


 However, when the configuration file contains host names, or when a
 server or client is configured remotely, host names are resolved using
 the DNS and a separate name resolution process.  In order to protect
 against bogus name server messages, name resolution messages are
 authenticated using an internally generated key which is normally
 invisible to the user. However, if cryptographic support is disabled,
 the name resolution process will fail.  This can be avoided either by
 specifying IP addresses instead of host names, which is generally
 inadvisable, or by enabling the flag for name resolution and disabled
 it once the name resolution process is complete.



As a side effect, when sending SIGQUIT or SIGTERM ntpd does not remove
the PID file created with the -p option (as in /usr/sbin/ntpd -p
/var/run/ntpd.pid) -- would that be a bug or a feature I don't
understand?


 Thanks in advance for any light on these issues & Cheers, Stefan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040321205823.C64884>