ntpd couldn't resolve host name on system boot

Jeremy Chadwick freebsd at jdc.parodius.com
Mon Oct 24 23:27:53 UTC 2011


On Tue, Oct 25, 2011 at 12:50:29AM +0200, Miroslav Lachman wrote:
> I have a problem with ntpd on many of our servers running
> 8.2-RELEASE or newer. Some of them are newly installed, most of them
> are 7.x upgraded to 8.2 or 8-STABLE amd64 with GENERIC.
> 
> Ntpd can't resolve host names on boot. This error did not existed on 7.x
>
> Oct 24 12:45:22 vcela kernel: Trying to mount root from
> ufs:/dev/mirror/gm0s1a
> Oct 24 12:45:23 vcela named[757]: starting BIND 9.6.-ESV-R3 -t
> /var/named -u bind
> Oct 24 12:45:23 vcela named[757]: built with '--prefix=/usr'
> '--infodir=/usr/share/info' '--mandir=/usr/share/man'
> '--enable-threads' '--enable-getifaddrs' '--disable-linux-caps'
> '--with-openssl=/usr' '--with-randomdev=/dev/random' '--without-idn'
> '--without-libxml2'
> Oct 24 12:45:23 vcela named[757]: command channel listening on 127.0.0.1#953
> Oct 24 12:45:23 vcela named[757]: command channel listening on ::1#953
> Oct 24 12:45:23 vcela named[757]: running
> Oct 24 12:45:24 vcela ntpd[960]: ntpd 4.2.4p5-a (1)
> Oct 24 12:45:24 vcela kernel: nfe0: link state changed to UP
> Oct 24 12:45:24 vcela kernel: acd0: FAILURE - ATA_IDENTIFY
> status=51<READY,DSC,ERROR> error=4<ABORTED> LBA=0
> Oct 24 12:45:31 vcela snmpd[1333]: send: Connection refused
> Oct 24 12:45:43 vcela ntpd_initres[986]: host name not found:
> 0.freebsd.pool.ntp.org
> Oct 24 12:45:43 vcela ntpd_initres[986]: couldn't resolve
> `0.freebsd.pool.ntp.org', giving up on it
> Oct 24 12:45:43 vcela ntpd_initres[986]: host name not found:
> 1.freebsd.pool.ntp.org
> Oct 24 12:45:43 vcela ntpd_initres[986]: couldn't resolve
> `1.freebsd.pool.ntp.org', giving up on it
> Oct 24 12:45:43 vcela ntpd_initres[986]: host name not found:
> 2.freebsd.pool.ntp.org
> Oct 24 12:45:43 vcela ntpd_initres[986]: couldn't resolve
> `2.freebsd.pool.ntp.org', giving up on it
> 
> Is there any know changes in network drivers (nfe or bge) or in
> order of rc scripts? It seems that nfe interface is bringed up too
> late.
> 
> I know there is rc.d/netwait in 8-STABLE, but it is not available on
> 8.2-RELEASE and I think that there is some regression as this error
> was not there in the time of FreeBSD 7.x.

The problem is that the networking layer is not TRULY available by the
time ntpd starts.  This does have to do with NIC drivers, but the same
behaviour can be seen on all NICs, including excellent ones like em(4).

You can use the rc.conf netwait_* variables to solve this problem.  I'm
the author of the script that got committed so that's how I know.  :-)
An example:

netwait_enable="yes"
netwait_ip="4.2.2.1 4.2.2.2"
netwait_if="em0"

If you need help setting this up, let me know.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, US |
| Making life hard for others since 1977.               PGP 4BD6C0CB |



More information about the freebsd-stable mailing list