[PATCH] new applet gethostbyname

Laurent Bercot ska-dietlibc at skarnet.org
Sun Jul 8 23:50:37 UTC 2012


> Quick fix, major absolutely correct:
> 
> /etc/nsswitch contains line:
> 
> hosts: files dns
> 
> /etc/host.conf contains:
> 
> order hosts, bind

 Ah, yes, I confused the syntaxes, sorry about that.

 /etc/nsswitch.conf indeed contains something like "hosts: files dns"
to configure NSS.

 The thing is that libresolv, the BIND DNS client library, *also* adds
a compatibility layer to /etc/hosts, in case someone doesn't want to use
NSS *but* still wants a /etc/hosts file for local DNS definitions.
/etc/host.conf is a configuration file for the libresolv, and
"order hosts, bind" means that DNS queries will first be answered using
the data in /etc/hosts if possible, and fall back on real DNS mechanisms
otherwise.
 Compatibility layer on compatibility layer!

 Conclusion: for direct DNS access, use the djbdns command-line tools,
the djbdns client library, or my client library. Less bloat, less
complexity, better interfaces. :P

-- 
 Laurent


More information about the busybox mailing list