cancel
Showing results for 
Search instead for 
Did you mean: 

NSSWITCH conf file.

SOLVED
Go to solution
Narendra Uttekar
Regular Advisor

NSSWITCH conf file.

Hi,

We were having problem with DNS server and because of that we were not able to ping the localhost. But we have already added localhost entry in /etc/hosts file. And also we have set the search preference in  /etc/nsswitch.conf as files first and then to look DNS.

 

So trying to understand why it was looking for DNS for localhost ping as it was already in /etc/hosts file. But after DNS server problem was fixed we were able to ping the localhost.

 

Please find the /etc/nsswitch.conf and /etc/resolv.conf file entries as below and let me know how we can fix this problem. As later on again if we had similar problem with DNS server it should have resolved through /etc/hosts file and no need to look to resolve through DNS for localhost.

 

server1:/# ping localhost

PING localhost.company.pvt: 64 byte packets

----localhost.company.pvt PING Statistics----

10 packets transmitted, 0 packets received, 100% packet loss

 

server1:/# cat /etc/nsswitch.conf
passwd:       compat
group:        compat
hosts:        files [NOTFOUND=continue] dns
ipnodes:      dns [NOTFOUND=return] nis [NOTFOUND=return] files
networks:     nis [NOTFOUND=return] files
protocols:    nis [NOTFOUND=return] files
rpc:          nis [NOTFOUND=return] files
publickey:    nis [NOTFOUND=return] files
netgroup:     nis [NOTFOUND=return] files
automount:    files nis
aliases:      files nis
services:     nis [NOTFOUND=return] files

 

server1:/# cat /etc/resolv.conf
domain company.pvt
nameserver 10.x.x.x

nameserver 10.x.x.x

 

Thanks,

Narendra

 

P.S. This thread has been moved from HP-UX>System Administration to  HP-UX > networking. -HP Forum Moderator

1 REPLY
Patrick Wallek
Honored Contributor
Solution

Re: NSSWITCH conf file.

I think your problem may be related to the 'ipnodes' line in your nsswitch.conf file.  This line can also have an impact on how things are looked up.

 

Both the hosts line and the ipnodes line should be the same.  So, I would change the ipnodes line so that it looks like:

 

ipnodes:      files [NOTFOUND=continue] dns