Bug 122780 - ntp.conf recognizes time servers only by numeric IP address, not by hostname
ntp.conf recognizes time servers only by numeric IP address, not by hostname
Product: Fedora
Classification: Fedora
Component: ntp (Show other bugs)
i686 Linux
medium Severity low
: ---
: ---
Assigned To: Harald Hoyer
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2004-05-07 16:53 EDT by Vaughn Gardner
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-06-01 05:31:24 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Vaughn Gardner 2004-05-07 16:53:47 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)

Description of problem:
I installed Fedora Core 1 fresh and replaced the file /etc/ntp.conf
with the working copy from a previous Red Hat 8 install.  When I
restarted ntpd it opened firewall holes for all of the server entries,
but ntpd only recognized my network router - my router was the only
time source specified by IP address.  I was able to get ntpd to
recognize the servers by replacing the hostname with the numeric IP
address in dotted-decimal format.

originally the server names in /etc/ntp.conf appeared as follows:
restrict clock2.redhat.com mask nomodify notrap noquery
server clock2.redhat.com

restarting the ntpd service resulted in the following error in
May  6 12:54:07 vhg ntpd[2949]: getnetnum: "clock2.redhat.com" invalid
host number, line ignored

NTP was unable to reach the host and rejected it for purposes of time

I was able to work around the issue by changing ntp.conf as follows:
restrict mask nomodify notrap noquery

Note that is the IP address returned by dig for
clock2.redhat.com.  With this change restarting the ntpd service
results in no error message, time synchronizes.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. install fedora core 1
2. place the following lines in /etc/ntp.conf:
restrict clock2.redhat.com mask nomodify notrap noquery
server clock2.redhat.com
3. start (or restart) NTP service (service ntpd [start|restart])

Actual Results:  ntpd does not resolve hostname, error message written
to /var/log/messages, ntpd lists server as unreachable internally,
does not use it for synchronization.

Expected Results:  ntpd finds server by hostname, accepts it as a
valid time source, evaluates its responses it in time synchronization

Additional info:

This behavior does not seem to agree with the NTP documentation as
found on http://www.eecis.udel.edu/~mills/ntp/html/notes.html (search
for "Configuring Your Server or Client" for the relevant section of
the page):
"Note the use of host names, although host addresses in dotted-quad
notation can also be used. It is always preferable to use names rather
than addresses, since over time the addresses can change, while the
names seldom change."

It also represents a change from Red Hat 8's behavior, where using the
hostname works just fine.

I suspect that this may be related to bug # 109638:  ntptrace missing.
 If ntpd is written to use ntptrace to resolve hostnames then removal
of ntptrace would prevent ntpd from resolving the time hosts.
Comment 1 Vaughn Gardner 2004-05-26 13:36:25 EDT
I've upgraded to Fedora Core 2, and hostnames work in ntp.conf again
(ntp version 4.2.0-7).

Note You need to log in before you can comment on or make changes to this bug.