Bypassing DNS?

Ben Scott dragonhawk at gmail.com
Fri Feb 24 14:30:00 EST 2006


On 2/24/06, mike ledoux <mwl+gnhlug at alumni.unh.edu> wrote:
> At least on my system, 'host' doesn't use /etc/nsswitch.conf at all:

  Good point.

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

  Yes.  "host", "dig", and "nslookup" all come from the BIND suite
(part of "bind-utils" on Red Hat).  They're DNS diagnostic tools, not
programs which use DNS as an application.

  Most programs (ping, Firefox, etc.) are going to use the
gethostby*() library calls, which is where NSS (the name service
switch) comes in.  In effect, Firefox calls
"gethostbyname(www.google.com)" to get the host information for
Google.  NSS might check local files, NIS, DNS, LDAP, SMB, or any
number of other things to get that information.

  The attached Perl script provides a command-line interface to the
gethostby*() calls.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gethost
Type: application/octet-stream
Size: 2530 bytes
Desc: not available
Url : http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20060224/47e61ff9/gethost.obj


More information about the gnhlug-discuss mailing list