From owner-freebsd-bugs@FreeBSD.ORG Thu Mar 18 18:40:03 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EC221065670 for ; Thu, 18 Mar 2010 18:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 52A258FC08 for ; Thu, 18 Mar 2010 18:40:03 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o2IIe3Df027672 for ; Thu, 18 Mar 2010 18:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o2IIe3KT027671; Thu, 18 Mar 2010 18:40:03 GMT (envelope-from gnats) Date: Thu, 18 Mar 2010 18:40:03 GMT Message-Id: <201003181840.o2IIe3KT027671@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Andrew Wilson Cc: Subject: Re: conf/144804: ntpd cannot resolve hostnames at system start X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andrew Wilson List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2010 18:40:03 -0000 The following reply was made to PR conf/144804; it has been noted by GNATS. From: Andrew Wilson To: =?KOI8-R?B?88HOxcsg59XSyc4=?= Cc: freebsd-gnats-submit@freebsd.org Subject: Re: conf/144804: ntpd cannot resolve hostnames at system start Date: Thu, 18 Mar 2010 13:04:17 -0500 2010/3/18 =F3=C1=CE=C5=CB =E7=D5=D2=C9=CE : >> Number: =9A =9A =9A =9A 144804 >> >Category: =9A =9A =9A conf >> >Synopsis: =9A =9A =9A ntpd cannot resolve hostnames at system start >> >Confidential: =9A no >> >Severity: =9A =9A =9A non-critical >> >Priority: =9A =9A =9A low >> >Responsible: =9A =9Afreebsd-bugs >> >State: =9A =9A =9A =9A =9Aopen >> >Quarter: >> >Keywords: >> >Date-Required: >> >Class: =9A =9A =9A =9A =9Asw-bug >> >Submitter-Id: =9A current-users >> >Arrival-Date: =9A Tue Mar 16 20:10:00 UTC 2010 >> >Closed-Date: >> >Last-Modified: >> >Originator: =9A =9A andy wilson >> >Release: =9A =9A =9A =9A8.0-RELEASE-p2 >> >Organization: >> >Environment: > FreeBSD urania.tx.net 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #1: Wed Mar 1= 0 13:27:38 CST 2010 =9A =9A root@urania.tx.net:/usr/obj/usr/src/sys/URANIA = =9Ai386 >> >Description: > > Due to network initialization taking longer at system startup on 8.0, ntp= d cannot resolve hostnames when it is run by /etc/rc.d/ntpd > > > It spits out some messages that look something like: > > ntpd_initres[1469]: host name not found: time.nist.gov > ntpd_initres[1469]: couldn't resolve `time.nist.gov', giving up on it > ntpd_initres[1469]: host name not found: time-b.nist.gov > ntpd_initres[1469]: couldn't resolve `time-b.nist.gov', giving up on it > ntpd_initres[1469]: host name not found: time-c.timefreq.bldrdoc.gov > ntpd_initres[1469]: couldn't resolve `time-c.timefreq.bldrdoc.gov', givin= g up on it > > > In this state ntpd isn't very useful until it is restarted after the netw= ork is ready to go. > > > > # ntpq -p > No association ID's returned > # /etc/rc.d/ntpd restart > Stopping ntpd. > Starting ntpd. > # ntpq -p > =9A =9A remote =9A =9A =9A =9A =9A refid =9A =9A =9Ast t when poll reach = =9A delay =9A offset =9Ajitter > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > =9Atime.nist.gov =9A .ACTS. =9A =9A =9A =9A =9A 1 u =9A =9A3 =9A 64 =9A = =9A1 =9A 40.103 =9A-20.364 =9A 0.004 > =9Atime-b.nist.gov .ACTS. =9A =9A =9A =9A =9A 1 u =9A =9A2 =9A 64 =9A =9A= 0 =9A =9A0.000 =9A =9A0.000 =9A 0.000 > =9Atime-C.timefreq .ACTS. =9A =9A =9A =9A =9A 1 u =9A =9A1 =9A 64 =9A =9A= 1 =9A 40.769 =9A-20.209 =9A 0.004 > =9Anist1.symmetric .ACTS. =9A =9A =9A =9A =9A 1 u =9A =9A1 =9A 64 =9A =9A= 1 =9A 67.883 =9A-11.069 =9A 0.004 > > > >> >How-To-Repeat: > > Configure time servers by hostname in /etc/ntp.conf, set ntpd_enable=3D"Y= ES" in rc.conf and reboot. > > >> >Fix: > > >> >Release-Note: >> >Audit-Trail: >> >Unformatted: > > this bug occurs when your system configured to use a dns server on the sa= me system. When a system is starting, the ntpd starts before the named. > The problem isn't limited to named; it occurs whether running named as a local resolver or setting a remote resolver in /etc/resolv.conf The problem in both cases is that network connectivity doesn't exist yet so name resolution fails when ntpd is started. The network interfaces are configured early on in the rc order, but it still takes about 20 seconds before packets can actually be sent (this quirk is new to FreeBSD 8). Any attempts to resolve hostnames before packets can be sent will fail. ntpd assumes that you have a working resolver when it is started.