1752806 Members
6045 Online
108789 Solutions
New Discussion юеВ

DNS, localhost

 
SOLVED
Go to solution
Victor Geere
Frequent Advisor

DNS, localhost

I can ping localhost but programs like HP-Eloquence and omniback constantly complains about not being able to resolve localhost, or other server names on the network. /etc/hosts contains the line :

127.0.0.1 localhost loopback

and nsswitch.conf contains the line

hosts: files dns

What am I missing?
I thought that I was because I had thought.
4 REPLIES 4
Stefan Farrelly
Honored Contributor

Re: DNS, localhost


Can you confirm it is looking it up in the hosts file;

nslookup localhost

looking up FILES
Name: localhost
Address: 127.0.0.1
Aliases: loopback
Im from Palmerston North, New Zealand, but somehow ended up in London...
Victor Geere
Frequent Advisor

Re: DNS, localhost

Nope, it tries to use the DNS and fails:


/etc>nslookup localhost
Name Server: titan.nda.co.za
Address: 192.28.16.65

Trying DNS
*** titan.nda.co.za can't find localhost: Non-existent domain
I thought that I was because I had thought.
Rainer von Bongartz
Honored Contributor
Solution

Re: DNS, localhost

Try putting this in /etc/nsswitch.conf

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


Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Nick Wickens
Respected Contributor

Re: DNS, localhost

What do you have in your /etc/resolv.conf file ??
Hats ? We don't need no stinkin' hats !!