Operating System - HP-UX
1820592 Members
1737 Online
109626 Solutions
New Discussion юеВ

update to /etc/nsswitch.conf

 
Chris Bentley
Advisor

update to /etc/nsswitch.conf

I have updated /etc/nsswitch.conf but the changes are not being reflected when I try to resolve ip addresses. How can I make sure the changes are being relected without a reboot?
5 REPLIES 5
Michael Tully
Honored Contributor

Re: update to /etc/nsswitch.conf

Hi,

Make sure that you resolve first from your
/etc/hosts file.

contents of /etc/resolv.conf
domain mydomain.com
nameserver 10.53.100.2
nameserver 10.53.100.2

# more /etc/nsswitch.conf
hosts: files [NOTFOUND=continue UNAVAIL=return TRYAGAIN=return] dns [NOTFO
UND=return UNAVAIL=continue TRYAGAIN=return]

To test startusing 'nslookup' that is certainly included in your /etc/hosts file.

HTH
~Michael
Anyone for a Mutiny ?
Deepak Extross
Honored Contributor

Re: update to /etc/nsswitch.conf

Processes that use nsswitch.conf usually read the entire file once at startup. If the file is later changed, the process will continue
using the old configuration.
You may have to kill the old processes and restart them, if you dont want to reboot.
Steve Steel
Honored Contributor

Re: update to /etc/nsswitch.conf

Hi

From man switch


EXAMPLES
An example of a valid name service switch entry is:

hosts : dns [NOTFOUND=continue UNAVAIL=return TRYAGAIN=continue] files

Just reverse the dns and files so dns is second choice.

The defaults are
cat /usr/newconfig/etc/nsswitch.conf
#
# /etc/nsswitch.conf
#
# This is the default configuration file for the name service switch.
# It will cause behavior similar to that performed on prior HP-UX
# releases when a configurable name service algorithm was not provided.
#
# If the /etc/nsswitch.conf file is not present, it will default to the
# behavior represented by the ordering and conditions below.
#
# See the Adminstering Internet Services Manual and the switch(4) man
# page for more information on the name service switch.
#

hosts: dns nis files
services: nis files
protocols: nis files
networks: nis files
rpc: nis files
netgroup: nis files
automount: nis files


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)

Re: update to /etc/nsswitch.conf

Hi Chris,

1. Check permissions on /etc/nsswitch.conf, should be 444.

2. From the man page for nsswitch.conf:

WARNINGS
Within each process that uses nsswitch.conf(), the entire file is read
only once. If the file is later changed, the process will continue
using the old configuration.

Have the processes that cannot be resolved been restarted?

3. Also can you post your nsswitch.conf file?

HTH

Duncan

I am an HPE Employee
Accept or Kudo
Steven Sim Kok Leong
Honored Contributor

Re: update to /etc/nsswitch.conf

Hi,

To verify that you have the /etc/nsswitch.conf configuration and permissions correct, login to the user (that has problems resolving the IP address) and perform this:

# nslookup
> policy

This will show the configured name resolution policy (i.e. order of using files, dns, nis etc in the resolution).

Hope this helps. Regards.

Steven Sim Kok Leong