DNS resolution issue.

Joshua Judson Rosen rozzin at geekspace.com
Mon Oct 18 15:03:41 EDT 2010


"Ken D'Ambrosio" <ken at jots.org> writes:
>
> Don't forget, also, that "host gildor.foo.local" and "host gildor"
> both came back, ASAP, with valid responses.  (Sidenote: I wonder if
> "host" bypasses nsswitch.conf entirely, and just checks DNS-specific
> files, such as resolv.conf.  Updated: I guess so.  I modified
> /etc/hosts to resolve gildor to 127.0.0.1.  That's where ping, then,
> looks, as per nsswitch.conf, but "host" still goes to the
> DNS-resolvable IP.  Which would explain the delay bit in the Ubuntu
> tech note, below.)

Yes--"host" is specifically a DNS tool, just like nslookup.
Also like nslookup, it's part of the BIND suite.

 From the manpage:

    NAME
           host - DNS lookup utility
[...]
    DESCRIPTION
           host is a simple utility for performing DNS lookups.


:^)

If you want to do general queries using nsswitch, you can use
the "getent" command, e.g.:

    getent hosts gildor.foo.local
    getent hosts gildor
    getent hosts gildor.local

(note that the "hosts" is literal--getent is more generic than just
hostname-lookups, so you need to specify which `database' to query;
e.g.: hosts, passwd, group, shadow, aliases, ethers, protocols...).

-- 
"Don't be afraid to ask (λf.((λx.xx) (λr.f(rr))))."



More information about the gnhlug-discuss mailing list