Operating System - Linux
1827816 Members
2403 Online
109969 Solutions
New Discussion

what is the difference between /etc/host.conf and /etc/nsswitch.conf

 
SOLVED
Go to solution
Jdamian
Respected Contributor

what is the difference between /etc/host.conf and /etc/nsswitch.conf

Hi

I'm not able to understand the diferences between /etc/host.conf and /etc/nsswitch.conf (in the case of host names).

Aren't they for the same purpose -- resolve host names ?

Thanx in advance
1 REPLY 1
Matti_Kurkela
Honored Contributor
Solution

Re: what is the difference between /etc/host.conf and /etc/nsswitch.conf

/etc/nsswitch.conf covers way more than host names: it also covers the resolution of mail aliases, user and group names, network protocol, service and segment names and others.

It uses the de-facto standard format originally defined by Sun Microsystems for Solaris 2.

Linux uses glibc, whose resolver library has more options than the standard format can handle. Creating an incompatible extended version of the nsswitch.conf file format would not have been a good idea: it would have caused unnecessary difficulties in porting Unix software for Linux.

Instead, the glibc developers chose to add a new configuration file for those glibc-specific extra options. This file is /etc/host.conf.

Once you've learned to use /etc/nsswitch.conf on Linux, you can apply this knowledge to Solaris and many other Unix-style OSs.

But /etc/host.conf is specific to glibc, so on other Unix-style OSs it might not exist or might be completely different.

If you need to work with multiple system architectures, it's important to know what is standardized and what is architecture-specific. This kind of separation into different files is actually rather convenient.

MK
MK