1850602 Members
4483 Online
104054 Solutions
New Discussion

Search out the others

 

Search out the others

My serving search out the others servers first in the net in dns later in hosts, I decided the problem removing dns in the archive nsswitch.conf it I was thus:

hosts: files dns

now he is thus:

hosts: files

What it can be causing this?

thanks!
6 REPLIES 6
Peter Godron
Honored Contributor

Re: Search out the others

Luc as,
did you remove the dns server entry?
If no dns server is defined, the system would not know where to look.
Add your dns server and all should be ok.

Re: Search out the others

Peter,
Dns decides the name of the servers but I would like that it I resolv /etc/hosts first.

Re: Search out the others

Peter,
It forgives I did not express right would like to know because it does not decide the names for the etc/hosts?
Peter Godron
Honored Contributor

Re: Search out the others

Lucas,
the nsswitch.conf file should look something like this:
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=continus TRYAGAIN=return]

Search /etc/hosts, if entry no found goto the dns.
James R. Ferguson
Acclaimed Contributor

Re: Search out the others

Hi Lucas:

If you want to consult the '/etc/hosts' first and then DNS, do:

hosts: files [NOTFOUND=continue] dns

Regards!

...JRF...
john kingsley
Honored Contributor

Re: Search out the others


hosts: files dns

will search dns only if the hostname can't be resolved in /etc/hosts.


hosts: files

Will only search /etc/hosts. It will not try and resolve a hostname against dns.

If you plan to use dns, you will also need to setup the /etc/resolv.conf file.