[Bug 736149] Re: Ubuntu 10.10 /etc/hosts ignored by /lib/resolv.so.2

David Favor david at davidfavor.com
Wed Mar 16 22:11:31 UTC 2011


ping works as expected...

root at net1# strace -e open /bin/ping localhost 2>&1
open("/etc/ld.so.cache", O_RDONLY)      = 3
open("/lib/libc.so.6", O_RDONLY)        = 3
open("/etc/resolv.conf", O_RDONLY)      = 4
open("/etc/resolv.conf", O_RDONLY)      = 4
open("/etc/nsswitch.conf", O_RDONLY)    = 4
open("/etc/ld.so.cache", O_RDONLY)      = 4
open("/lib/libnss_files.so.2", O_RDONLY) = 4
open("/etc/host.conf", O_RDONLY)        = 4
open("/etc/hosts", O_RDONLY|O_CLOEXEC)  = 4

Hum... Looks like resolver conf files are walked in libc...

root at net1# ldd /bin/ping
	linux-vdso.so.1 =>  (0x00007fff63452000)
	libc.so.6 => /lib/libc.so.6 (0x00007f6585db6000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f6586145000)

root at net1# strings /lib/libc.so.6 | grep /etc
/etc/localtime
/etc/gai.conf
/etc/mtab
/etc/hostid
/etc/ttys
/etc/shells
/etc/fstab
/etc/.pwd.lock
/etc/resolv.conf
/etc/host.conf
/etc/nsswitch.conf
/etc/hosts.equiv
/etc/bindresvport.blacklist

So the question is why the host command ignores all these files and ping
honors them.

Or rather howto configure system wide honoring of all these files for
resolver access from any command.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to bind9 in ubuntu.
https://bugs.launchpad.net/bugs/736149

Title:
  Ubuntu 10.10 /etc/hosts ignored by /lib/resolv.so.2



More information about the Ubuntu-server-bugs mailing list