Harry Putnam wrote:
> "Mr. Demeanour" <[email protected]> writes:
> 
>> Harry Putnam wrote:
>>> Further... I'm not sure where cmds like gethostbyname (and
>>> similar ones) get the info either... for all I know they may just
>>> grep /etc/hosts.
>> man resolv.conf (i.e. it's configurable).
> 
> I'm not sure how that would return the miss-typed name in /etc/hosts 
> There is not mention of the hosts file in man resolve.conf what so
> ever.

Sorry, my response was both too terse and inaccurate. I should have
pointed you instead at /etc/nsswitch.conf, which the name-resolution
library (i.e. gethostbyname()) uses to figure-out how it's supposed to
resolve hostnames into addresses.

There's a line in there that starts with "hosts: ", usually followed on
the same line by "files" and "dns" in that order (and often accompanied
by other bits). That says that to resolve "hosts", you should first look
at "files", then at "dns". In this context, "files" means "/etc/hosts".

So if your nsswitch.conf mentions "files" in the "hosts:" line before
"dns", that is telling the local name-resolution library to look at
/etc/hosts, and use any answer it can get from there in preference to a
real DNS lookup.

I hope that's a bit more helpful!

-- 
Jack.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com

Reply via email to