Unwanted resolver usage of /etc/host.conf

Andris Kalnozols andris at hpl.hp.com
Sat Feb 23 03:28:39 UTC 2013


Hi.

Although not a BIND-related issue, I would like to ask if someone could
explain the conditions under which a compiled C program on Linux could
be made to have a name resolution dependency on the settings within the
file `/etc/host.conf'.  As I understand things, host.conf is the ancestor
of the nsswitch.conf file.  Here is my situation:

   * The development branch of NTP up to and including 4.2.7p346 shows
     normal name resolution.  The following servers appear in /etc/ntp.conf:

       usno.pa-x.dec.com  (also appears in /etc/hosts)
       clock.fmt.he.net   (not in /etc/hosts)
       clock.sjc.he.net   (not in /etc/hosts)
       gps.layer42.net    (not in /etc/hosts)

   * /etc/nsswitch.conf is configured with "hosts: files dns"

   * When the NTP daemon is started, it queries DNS for the three servers
     which do not appear in /etc/hosts, i.e., the expected behavior.

However, NTP versions 4.2.7p347 and later were not querying DNS for
the three servers which are not listed in my /etc/hosts file.

I stumbled upon the /etc/host.conf file and had to add the following
line to get name resolution working again:

   order  hosts,bind

The other workaround was to remove "files" as a service specification
from `/etc/nsswitch.conf', i.e., "hosts: dns".

The normal and problematic ntpd executable files have identical
references to the following shared libraries:

clepsydra# ldd /usr/sbin/ntpd
         linux-vdso.so.1 =>  (0x00007fff7bcbc000)
         librt.so.1 => /lib/librt.so.1 (0x00007f4d5821b000)
         libcap.so.2 => /lib/libcap.so.2 (0x00007f4d58017000)
         libm.so.6 => /lib/libm.so.6 (0x00007f4d57d94000)
         libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 
(0x00007f4d579f3000)
         libdl.so.2 => /lib/libdl.so.2 (0x00007f4d577ef000)
         libc.so.6 => /lib/libc.so.6 (0x00007f4d5748c000)
         libpthread.so.0 => /lib/libpthread.so.0 (0x00007f4d57270000)
         /lib64/ld-linux-x86-64.so.2 (0x00007f4d58432000)
         libattr.so.1 => /lib/libattr.so.1 (0x00007f4d5706c000)
         libz.so.1 => /usr/lib/libz.so.1 (0x00007f4d56e54000)

A very quick search through the header files in /usr/include
did not reveal any references to a compile-time macro setting
which would enable the usage of "host.conf" when resolving names.

Is there someone who is more experienced in working with the Linux
resolver libraries shed some light on this?

Thanks,
Andris






More information about the bind-users mailing list