HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

nsswitch.conf configuration

 
HPquestion
Regular Advisor

nsswitch.conf configuration

We have HP-UX 11i ( 11.23). We don't have nsswitch.conf file configured in the system ( /etc direcctory) .

1. From which file, the system getting the default configuration without the /etc/nsswitch.conf file ?

2. I just want to alter hosts lookup as
hosts files dns nis

Can I just create a nsswitch.conf file with only the above line there? I don't want to alter any other default settings in the system to avoid any possible errors. If I don't define the group, password , protocols etc etc, in /etc/nsswitch.conf file, will system work fine the new hosts information from /etc/nsswitch.conf and the existing default settings from somewhere?
10 REPLIES
James R. Ferguson
Acclaimed Contributor

Re: nsswitch.conf configuration

Hi:

You have to select the flavor you want. For example:

# cp -p /etc/nsswitch.files /etc/nsswitch.conf

Then, you might modify the "hosts" line to look like:

hosts: files [NOTFOUND=continue] dns

Regards!

...JRF...
HPquestion
Regular Advisor

Re: nsswitch.conf configuration

Can I just create a nsswitch.conf file with only the above line there? I don't want to alter any other default settings in the system to avoid any possible errors. If I don't define the group, password , protocols etc etc, in /etc/nsswitch.conf file, will system work fine the new hosts information from /etc/nsswitch.conf and the existing default settings from somewhere?
James R. Ferguson
Acclaimed Contributor

Re: nsswitch.conf configuration

Hi:

I would copy an appropriate template. See:

http://www.docs.hp.com/en/B3921-60631/nsswitch.conf.4.html

Regards!

...JRF...
HPquestion
Regular Advisor

Re: nsswitch.conf configuration

How I know what are my current default setup?
Accordingly I can edit the templates?
From where the system is getting the default information without nsswitch.conf file?
itayha
Occasional Contributor

Re: nsswitch.conf configuration

Hi,
You can find some defaults files under: /usr/newconfig/etc
or you just find examples for with the right syntax using man nsswitch.conf
Michael Steele_2
Honored Contributor

Re: nsswitch.conf configuration

Hi

'itayha' is correct. Use the /usr/newconfig/etc/nsswitch.conf default.
Support Fatherhood - Stop Family Law
James R. Ferguson
Acclaimed Contributor

Re: nsswitch.conf configuration

HI (again):

> How I know what are my current default setup?
Accordingly I can edit the templates?
From where the system is getting the default information without nsswitch.conf file?

If you take a few minutes and read the manpages I cited you will note that they say, "The library functions contain compiled-in default entries that are used if the appropriate entry in nsswitch.conf is absent or syntactically incorrect. The entries are as follows:..."

Regards!

...JRF...
Javed Khan_1
Valued Contributor

Re: nsswitch.conf configuration

Hi,

if you do not have nsswitch.conf file present on your system but for you system default location to search is files only in other word

no nsswitch.conf = nsswitch.conf with content of nsswitch.files

Javed
Never Give Up
HPquestion
Regular Advisor

Re: nsswitch.conf configuration


James,
The link has the below information.
"
The library functions contain compiled-in default entries that are used if the appropriate entry in nsswitch.conf is absent or syntactically incorrect. The entries are as follows:


hosts:
dns [NOTFOUND=return] nis [NOTFOUND=return] files
etc
"

It doesn't look like the system default setup.

My system is behaving differntly. As per the above setup host lookup should stop at dns as it has NOTFOUND=return there.


@/usr/newconfig/etc>nslookup aa


Trying DNS
Trying NIS
looking up FILES
*** No address information is available for "aa"
@/usr/newconfig/etc>

as hosts:
dns [NOTFOUND=return] nis [NOTFOUND=return] files >

@/usr/newconfig/etc>cp nsswitch.hp_defaults /etc/nsswitch.conf





@/usr/newconfig/etc>nslookup aa


Trying DNS
*** can't find aa: Non-existent domain

ricr3tst@/usr/newconfig/etc>

sujit kumar singh
Honored Contributor

Re: nsswitch.conf configuration

Hi


could have taken a help from
man 4 nsswitch.conf

passwd: files nis
group: files nis
hosts: 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
automount: files nis
aliases: files nis
services: files nis
sendmailvars: files
ipnodes: files



regards