[nsdispatch] hosts(5) does not override DNS lookup?

Erich Dollansky oceanare at pacific.net.sg
Wed Sep 12 20:33:55 PDT 2007


Hi,

I have had the same behaviour.

LI Xin wrote:
> 
> Recently one of our local user has found that he was unable to use
> hosts(5) to override "localhost" lookup that happens in DNS, while doing
> rpc_clnt_create.  A preliminary investigate of this seems to be related
> to nsdispatch, by replacing:
> 
> hosts: files dns
> 
> With:
> 
> hosts: files
> 
> in /etc/nsswitch.conf, it does not query DNS.
> 
> Before diving into NSSWITCH code, I'd like to know if this is expected
> behavior?  Say, when we have a match in hosts(5), should we even bother
> to query DNS if configured hosts: files dns?
> 
After getting a hint on the list, I found out that some strange 
characters in hosts made the file useless. After retyping hosts, hosts 
was accepted again.

I was not able to find out what character it was. I expected CR, but it 
was not the case.

Just retype or copy it from a working system.

Erich


More information about the freebsd-net mailing list