LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Name resolution with no nameserver indicated (https://www.linuxquestions.org/questions/linux-newbie-8/name-resolution-with-no-nameserver-indicated-723650/)

priceda332 05-04-2009 02:53 PM

Name resolution with no nameserver indicated
 
I have a RHEL cluster -- and no /etc/resolv.conf file and only an /etc/hosts file for name resolution. The /etc/nsswitch.conf file has the hosts line --> hosts files dns. This seems to be as expected -- however, on 'nslookup', I can try to resolve a hostname that is defined in my hosts file yet I get ";; connection timed out; no servers could be reached".
There should not be an attempt to query a nameserver as one is not defined -- I have checked the IPTABLES and they are off on one server and on on a few others -- yet the result is consistently the same.
I am able to successfully ping/telnet/SSH from all the nodes defined in the /etc/hosts file -- it is just that the 'nslookup' command fails.
Any ideas?

Thanks!

Dan

Tinkster 05-04-2009 03:20 PM

Hi, welcome to LQ,

That will be because it's explicitly programmed to query DNS
servers over a network interface. Same for the program host.

"Name resolution" via "gethostbyname" or "gethostbyaddr" will
work quite happily with what's defined in nsswitch.conf; nslookup
and host won't.


Cheers,
Tink

priceda332 05-05-2009 08:09 AM

Tinkster,

Thanks very much for the tip -- looks like a little 'gotcha' from RHEL got me. :)

Tip o'my hat to ya,

Dan


All times are GMT -5. The time now is 07:06 PM.