Bypassing DNS?

Michael ODonnell michael.odonnell at comcast.net
Fri Feb 24 12:48:00 EST 2006


> I believe this is by design, the host command is specifically
> intended to query DNS.

The following quick test tends to confirm what MWL is saying
and apparently shows the "host" tool using only libresolv while
another tool ("ping, in this example) then proceeds to libnss:

 % strace host bogusHostName 2>&1 | fgrep -i -e resolv -e nss
 open("/lib/tls/libresolv.so.2", O_RDONLY) = 3
 open("/etc/resolv.conf", O_RDONLY)      = 3

 % strace ping bogusHostName 2>&1 | fgrep -i -e resolv -e nss
 open("/lib/tls/libresolv.so.2", O_RDONLY) = 3
 open("/etc/resolv.conf", O_RDONLY)      = 3
 open("/etc/nsswitch.conf", O_RDONLY)    = 3
 read(3, "# /etc/nsswitch.conf\n#\n# Example"..., 4096) = 465
 open("/lib/tls/libnss_files.so.2", O_RDONLY) = 3
 open("/lib/tls/libnss_dns.so.2", O_RDONLY) = 3
 



More information about the gnhlug-discuss mailing list