LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   nsswitch.conf and host.conf differences (https://www.linuxquestions.org/questions/linux-networking-3/nsswitch-conf-and-host-conf-differences-245956/)

peter72 10-22-2004 10:01 AM

nsswitch.conf and host.conf differences
 
Have a network name resolution question.

What is the difference between the resolution name path in the /etc/host.conf and in the /etc/nsswitch.conf?

I know nsswitch.conf, from my solaris days, and have never even used the host.conf. How can you have 2 different files for where to look for name resolution?

acid_kewpie 10-22-2004 10:08 AM

nsswitch controls what methods are used to resolve the names. hosts contains the actual entries that will be read if nsswitch is set to resolve via hosts (i.e. "files" in nsswitch), as opposed to dns, nis

peter72 10-22-2004 10:44 AM

I think I see, but can you confirm this.

If I set my nsswitch.conf to

hosts: files dns

Then it looks to host.conf which reads

order hosts,bind

So could I take out dns in the nsswitch.conf since it is referenced in the host.conf?

acid_kewpie 10-22-2004 10:47 AM

apologies i am a retard. i thought you meant /etc/hosts. now you've got me wondering too...

emailssent 10-23-2004 01:02 AM

Did u googled for it. Google has almost every thing for u.

Here is solution for u,

The host.conf file is one of the configuration files used to set the order
of precedence among the various name services. The host.conf file defines serveral
options that control how the /etc/hosts file is processed and how it interacts wi
th DNS.

The nsswitch.conf file handles much more than just the order of prec
edence b/w the host table and DNS. It defines the sources for several different s
ystem administration databases becz. it is an outgrowth of the NIS.

The nsswitch.conf file has superseded the host.conf file becz. it provides more co
ntrol over more resources. Linux systems generally have both files configured , bu
t the action takes place in the nsswitch.conf file

Now the difference,

host.conf file is an older file used for order of precendece among various
name services. whereas nsswitch.conf file is newer one as compared to host.
conf file.

host.conf is an old configuration file that does some of what nsswitch.conf does a nd is still in use.

So, question is why host.conf file is present in system when nsswithc does everthing becz as of old architecture follows host.conf file , today also some system first looks for host.conf.


For more info and clarity google for it.
Source from where i am answering this is Craig Hunt book on DNS server. Above is all as far as i am remembering.


-jack


All times are GMT -5. The time now is 02:53 PM.