• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1963
  • Last Modified:

Functionality of ipnodes and hosts in /etc/nsswitch.conf ?

Given below entry in /etc/nsswitch.conf file, How the resolving of hostname is functioning here ?
Should I consider,

-> if the entry exists in NIS database then lookup always succeeds
-> if the entry exists in /etc/inet/ipnodes then lookup always succeeds
-> if the entry doesn't exists in NIS database then lookup always fails
-> if the entry does not exist in either NIS or /etc/inet/ipnodes, the lookup always fails ?
#cat /etc/nsswitch.conf
<snip>
ipnodes: files [NOTFOUND=return]
hosts: nis [NOTFOUND=return] files
<snip>
 
#also
bash-3.00# ls -l /etc/hosts 
lrwxrwxrwx   1 root     root          12 May  9  2008 /etc/hosts -> ./inet/hosts
bash-3.00# ls -l /etc/inet/ipnodes 
lrwxrwxrwx   1 root     root           7 May  9  2008 /etc/inet/ipnodes -> ./hosts
bash-3.00# ls -l /etc/inet/hosts   
-r--r--r--   1 root     root        3811 Apr 22 11:10 /etc/inet/hosts

Open in new window

0
beer9
Asked:
beer9
  • 2
  • 2
1 Solution
 
omarfaridCommented:
why you put [NOTFOUND=return] in both entries ?
0
 
Brian UtterbackPrinciple Software EngineerCommented:
He didn't put it there. It is in the nsswtich.nis example file.

I am sorry, but I don't understand your question. Could you clarify what you are asking?
0
 
beer9Author Commented:
If we heave both entry like 'ipnodes' and 'hosts' in nsswitch.conf then what is which file is gets consultant first for the name resolution?
0
 
Brian UtterbackPrinciple Software EngineerCommented:
It depends on which naming service is in use. If you are using a service that requires ipnodes, then the ipnodes
linr is used. If you are using a service that requires hosts, then the hosts line is used. It does not use both for any
one lookup.

However, when the ipnodes file was removed and replaced with a link to the hosts file, all the services that used
ipnodes were changed to use hosts as well, so it is very unlikely that the ipnodes line will be used at all. It was
only left in for backwards compatibility.
0
 
beer9Author Commented:
Thank blu! :-)
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now