Operating System - HP-UX
1833828 Members
1984 Online
110063 Solutions
New Discussion

any way to list default behavior of /etc/resolv.conf

 
SOLVED
Go to solution
Jay D Koonz
Occasional Advisor

any way to list default behavior of /etc/resolv.conf

I have a bunch of servers with no /etc/resolv.conf file. Are there any commands to list the search order (dns, files, nis) for the various items (hosts, passwd, services, etc) ??
Ride Boldly Ride, but watch out for El Dorados
8 REPLIES 8
pap
Respected Contributor

Re: any way to list default behavior of /etc/resolv.conf

Hi,
You can open the file /etc/nsswitch.conf file to look at the search order for various files like /etc/services, hosts, group , password, protocols....etc...etc...

-pap
"Winners don't do different things , they do things differently"
Jeff Schussele
Honored Contributor

Re: any way to list default behavior of /etc/resolv.conf

Hi Jay,

Search type is in nsswitch.conf and default is files only.
resolv.conf sets domain name serach order & "addition" of domain names for shortname searches, & DNS server search order.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Darrell Allen
Honored Contributor

Re: any way to list default behavior of /etc/resolv.conf

Hi Jay,

You should be looking at /etc/nsswitch.conf. Man nsswitch.conf and check out the compiled-in default entries listed under "Useful Configurations". NIS is first for a number of the databases, including hostname resolution.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
MANOJ SRIVASTAVA
Honored Contributor

Re: any way to list default behavior of /etc/resolv.conf

Hi Jay,

The search order is defined in /etc/nsswitch.conf file , but it looks for /etc/rsolv.conf to find the nameserver where the DNS entries reside , so in case you donot have resolve .conf but the nsswitch point to that then there will eb problem to address even the local hostname . I do a simple test to find how the name is being resolved nslookup < local hostaname > and nslookup < other server name > and find out how the name is being resolved, incase there is some issue then may be rename resolv.conf and retry it and correct resolv.conf if need be.

Manoj Srivastava
James R. Ferguson
Acclaimed Contributor
Solution

Re: any way to list default behavior of /etc/resolv.conf

Hi Jay:

Dynamically, you can do this:

# nslookup
> policy

That is, when 'nslookup' prompts you for a name, enter the token "policy".

Regards!

...JRF...
Jay D Koonz
Occasional Advisor

Re: any way to list default behavior of /etc/resolv.conf

As a bunch of you pointed out, nsswitch.conf is the file that defines the order. And what I meant to say was the servers don't have a nsswitch.conf file. I was hoping there was a way to verify what the behavior taking place was, but I guess the answer is "to check the man page for the defaults".
Ride Boldly Ride, but watch out for El Dorados
Olav Baadsvik
Esteemed Contributor

Re: any way to list default behavior of /etc/resolv.conf


Hi,

The use of nslookup gives you the correct
info even if you do not have a /etc/nsswitch.conf file

Enter this command:

nslookup -swdebug

It will give you some messages saying
that it can not find /etc/nsswitch.conf
but when you enter the command
policy
it will show you where it checks for
name-resolution

Regards
Olav
melvyn burnard
Honored Contributor

Re: any way to list default behavior of /etc/resolv.conf

do:

#nslookup
>policy
>exit
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!