Operating System - HP-UX
1833923 Members
3425 Online
110063 Solutions
New Discussion

dns hosts nsswitch question

 
SOLVED
Go to solution

dns hosts nsswitch question

i have a need to put some entries in a hosts file for local name resolution on an hpux 11.23 system

the problem is that entries in the hosts file dont seem to make a differance. they still wont resolve. i presume the issue is my nsswitch.conf is set to resolve names via dns then return if not found.

looking in sam it seems that the system is configured to use the hosts file.

| === Networking and Communications (hpux2) (1) |
|File View Options Actions Help |
|Name Service Switch |
|-------------------------------------------------------------------------------
| Type of First Second Third Fourth |
| Information Source Source Source Source |
|-------------------------------------------------------------------------------
| aliases /etc/aliases NIS |
| automount Local Files NIS |
| group /etc/group NIS |
| hosts DNS NIS /etc/hosts |
...
...
...




though i dont know where sam is getting this info. there is no nsswitch.conf in etc. only the following examples.


root@hpux2:$ls -l /etc/nssw*
-r--r--r-- 1 bin bin 566 Sep 3 2003 /etc/nsswitch.compat
-r--r--r-- 1 bin bin 391 Sep 3 2003 /etc/nsswitch.files
-r--r--r-- 1 bin bin 615 Sep 3 2003 /etc/nsswitch.hp_defaults
-r--r--r-- 1 bin bin 551 Sep 3 2003 /etc/nsswitch.nis
-r--r--r-- 1 bin bin 604 Sep 3 2003 /etc/nsswitch.nisplus


im fine with creating a /etc/nsswitch.conf via sam or via but im concerned about why there is no existing nsswitch.conf to start with.

I also have concerns about modifying the nsswitch.conf and wether a reboot will be required or not. ive seen mixed posts in the forums, some say a reboot is required, others say not.

could some kind expert please provide some insight?

many thanks in advance.
-mike
3 REPLIES 3
TTr
Honored Contributor

Re: dns hosts nsswitch question

What SAM is showing is the default behavior if there is no nsswitch.conf file. If you want to override the name resolution order you have to create an nsswitch.conf file. The other nsswitch.conf..??? files are given as examples, they are ignored by the lookup service.
Solution

Re: dns hosts nsswitch question

In the absence of an actual /etc/nsswitch.conf file, HP-UX will go with a set of defaults which you will find in the file /etc/nsswitch.hp_defaults (although editing this file won't change those defaults).

I'd copy /etc/nsswitch.hp_defaults to /etc/nsswitch.conf and edit as required. You shouldn't need a reboot for changes to take effect, although some applications will cache name lookups, so you might have to restart some processes.

HTH

Duncan

I am an HPE Employee
Accept or Kudo

Re: dns hosts nsswitch question

thanks for the prompt and excellent answers

this is just what i was looking for