LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Name Resolution (https://www.linuxquestions.org/questions/linux-networking-3/name-resolution-11582/)

jbooker 01-11-2002 01:27 PM

Name Resolution
 
RedHat 7.2 with a static ip --

nsswitch.conf has a line like this:
hosts: files dns

When I try to resolve a hostname that is NOT in DNS, but I have
the hostname in my /etc/hosts file, it will not resolve. If I telnet
to that same hostname, or ping it, it works fine. I have tried
moving the resolv.conf file to a different name, thinking that would force nslookup to use my /etc/hosts file, but that didn't even work. Any ideas? Thanks,

Jim - the newest newbie

BaerRS 01-11-2002 05:43 PM

Jim,

try to ping someting that is not on your network

ping lajdflajsf

then try to ping your now entry that is in the /etc/host file

johnlee 01-12-2002 02:18 AM

Re:
 
Dear Friend,

Check your /etc/host.conf file that should be

order hosts,bind


Thank You

John Lee

jbooker 01-14-2002 09:19 AM

ping and telnet work fine and my host.conf does have the line
"order hosts,bind".

Still, I can't resolve a hostname that is not in DNS. Somethin
is preventing the /etc/hosts file from being looked at.

I'm dying here. I have asked everyone I know for help and several
forums. HELP!!!

johnmc 01-15-2002 05:58 PM

Cut from the first line of the nslookup man page:

"Nslookup is a program to query Internet domain name servers."

The reason nslookup does not work for hosts not in DNS is that it is specifically designed to query name servers. So if you have a host defined in /etc/hosts but not defined in your DNS, nslookup will error with Non-existent host/domain.

nslookup is good for troubleshooting nameservers.

I hope this explains it for you.

jbooker 01-16-2002 08:38 AM

It's true that nslookup does query name servers, most of the time. However, if you specify in your /etc/nsswitch.conf file that
you want "files" to be queried too - like so:
"hosts: files [NOTFOUND=continue] dns"
nslookup is supposed to look at the /etc/hosts file first.

astickar 07-04-2003 01:02 PM

What happened with this Q ?

Do you know if someone knows how to solve this problem? If you know, I would be grateful if you could tell me how to solve it.

I have the same problem with the nslookup. Oracle Installation script use it in the pre-execution task.
Thanks.


All times are GMT -5. The time now is 05:09 PM.