Operating System - HP-UX
1826319 Members
3627 Online
109692 Solutions
New Discussion

could not resolve /etc/hosts if DNS resolver is configured

 
SOLVED
Go to solution
Burhan Koni
Advisor

could not resolve /etc/hosts if DNS resolver is configured

Hello
I have HP-UX 11i. if I configure DNS RESOLVER then the entries in /etc/hosts could not be resolved.

how can I get the resolution from both?

thank u
4 REPLIES 4
Sunil Sharma_1
Honored Contributor
Solution

Re: could not resolve /etc/hosts if DNS resolver is configured

Hi,

You have to use /etc/nsswitch.conf file for this entry will be looks like this

hosts dns files

Regards

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
G. Vrijhoeven
Honored Contributor

Re: could not resolve /etc/hosts if DNS resolver is configured

Hi,

Sunil is right the nsswitch.conf is the file to check. for hosts it uses dns and if not found it checks the file /etc/hosts.
To use DNS you need to configure the /etc/resolv.conf file.

If you do not have an DNS server just delete the dns entry in the nsswitch.conf file.

Gideon
Joseph Loo
Honored Contributor

Re: could not resolve /etc/hosts if DNS resolver is configured

hi,

create file and insert the line :

# vi /etc/nsswitch.conf
hosts: files dns

and save.

this file will search /etc/hosts first and if the entry is not found proceed to the DNS.

regards.
what you do not see does not mean you should not believe
Pete Randall
Outstanding Contributor

Re: could not resolve /etc/hosts if DNS resolver is configured

Actually, a proper nsswitch entry looks something like this:

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


Pete

Pete