Bug 122780 - ntp.conf recognizes time servers only by numeric IP address, not by hostname
Summary: ntp.conf recognizes time servers only by numeric IP address, not by hostname
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: ntp
Version: 1
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-05-07 20:53 UTC by Vaughn Gardner
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-06-01 09:31:24 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Vaughn Gardner 2004-05-07 20:53:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)
Gecko/20031114

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 255.255.255.255 nomodify notrap noquery
server clock2.redhat.com

restarting the ntpd service resulted in the following error in
/var/log/messages:
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
synchronization.

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

Note that 209.132.176.4 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):
ntp-4.1.2-5

How reproducible:
Always

Steps to Reproduce:
1. install fedora core 1
2. place the following lines in /etc/ntp.conf:
restrict clock2.redhat.com mask 255.255.255.255 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
algorithm.

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 17:36:25 UTC
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.