Operating System - Linux
1819501 Members
3388 Online
109603 Solutions
New Discussion юеВ

nslookup issue in redhat 9

 
Binu_5
Regular Advisor

nslookup issue in redhat 9

Hi

I am facing some problem with nslookup in redhat linux 9 . I have added a host in /etc/hosts.and the search order in /etc/nsswitch.conf is like the following
hosts: files nis dns

but when I give an nslookup the error follows
root@wiplx14 etc]# nslookup wiplx14
Note: nslookup is deprecated and may be removed from future releases.
Consider using the `dig' or `host' programs instead. Run nslookup with
the `-sil[ent]' option to prevent this message from appearing.
Server: 10.200.50.100
Address: 10.200.50.100#53

** server can't find wiplx14: SERVFAIL

The system directly contactinf the DNS server
which is 10.200.50.100..

Please help

Thanks
Binu




6 REPLIES 6
Alexander Chuzhoy
Honored Contributor

Re: nslookup issue in redhat 9

nslookup is used to query DNS servers.
you can try to ping to this hostname and see if it gets resolved,or
you can issue
dig -f /etc/hosts hostname
where hostname is the name that you've added to /etc/hosts
Florian Heigl (new acc)
Honored Contributor

Re: nslookup issue in redhat 9

do You have a domain name set in /etc/resolv.conf?

nslookup will usually use the DNS, as already stated. You can simply use the command 'host' to the Your resolver, but I'm not really sure You'll be happy with a DNS that can't resolve itself (unless it's just a domain suffix issue, of course).
yesterday I stood at the edge. Today I'm one step ahead.
Binu_5
Regular Advisor

Re: nslookup issue in redhat 9

Hi

I dont want want resolve my hostname using dns but I want from /etc/hosts or from the nis server .. Is it possible

Thanks
Binu
Ivan Ferreira
Honored Contributor

Re: nslookup issue in redhat 9

Simply use the ping command to test name resolution.

Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Paul Cross_1
Respected Contributor

Re: nslookup issue in redhat 9

If I'm understanding you correctly you have added a host name to /etc/hosts and you are trying to nslookup that host. Correct?

If this is what you are trying to do, the short answer is: you can't. nslookup doesn't querry /etc/hosts, or NIS. nslookup querries dns only. As mentioned above, you can try the host command, or dig, as mentioned above. If you need to add the host to DNS, you should talk to your DNS admin to do that (because I'm assuming from the nature of your question that you aren't the DNS admin).
Muthukumar_5
Honored Contributor

Re: nslookup issue in redhat 9

Yes. Set /etc/nsswitch.conf file as,

hosts: files nis

It will try to resolve hostname as,

files then nis configuration.

It will not use dns for this.

hth.
Easy to suggest when don't know about the problem!