1820592 Members
1918 Online
109626 Solutions
New Discussion юеВ

nslookup doing nothing

 

nslookup doing nothing

I am trying to configure a server so that it uses /etc/hosts files first, than 2 DNS servers.

So I have one line in my /etc/nsswitch.conf :

hosts: files dns [NOTFOUND=return]

and 2 lines in my /etc/resolv.conf :

nameserver A.B.C.D
nameserver E.F.G.H

(ip addresses of course, not A.B...)

I works without problem, but nslookup just does nothing. I type nslookup and nothing, nslookup with options, hostname, etc.. nothing. No error message, no message at all, nothing. Anything wrong ?

Version of nslookup :

$Revision: vw: -RW selectors: 'ic27d' -proj integ -- ph_ic27d_i80 'cupi80_ic27dbase_pb(08-Nov-00.16:48:14)' 'BE11.11_IC27A'
Wed Nov 8 18:20:24 PST 2000 $
getinfo.c 5.26 (Berkeley) 3/21/91
Copyright (c) 1985,1989 Regents of the University of California.
main.c 5.42 (Berkeley) 3/3/91
nslookup $Revision: 1.1.213.2 $ Fri Mar 17 13:36:43 GMT 2000

HP-UX 11.11 Thanks
8 REPLIES 8
steven Burgess_2
Honored Contributor

Re: nslookup doing nothing

Stephane

Try

/etc/nsswitch.conf

hosts: files [NOTFOUND=continue] dns

In you /etc/resolve.conf , you have your nameservers ok but you are missing one key element

search
nameserver A.B.C.D
nameserver E.F.G.H

HTH

Steve
take your time and think things through

Re: nslookup doing nothing

I was testing this :

hosts: files [NOTFOUND=continue] dns

and

search
nameserver A.B.C.D
nameserver E.F.G.H

I added the search to my domain but it didn't help. nslookup still doesn't say a word..

Re: nslookup doing nothing

*** Can't find server name for address A.B.C.D: Timed out

I tried to ping the first nameserver of my resolv.conf, it is down, and the second server is up..

Does nslookup search first in hosts and then on the DNS servers as I told in nsswitch ?
Ravi_8
Honored Contributor

Re: nslookup doing nothing

Hi,
In /etc/nsswitch.conf entry should look like this,

hosts: files [NOTFOUND=continue] dns
While adding DNS servers
nameserver A.B.C.D and
nameserver E.F.G.H
use SAM , by making entry in /etc/resolv.conf wouldn't work.
never give up
steven Burgess_2
Honored Contributor

Re: nslookup doing nothing

Hi

Have you tried with another address.

Try

grep /etc/hosts

I take it won't be there because nsswitch can't find it and is having to resort to looking at dns

The first entry in your /etc/resolv.conf i take it is your primary dns server

You can get nslookup to go straight to the secondary with the use of the server command

With the way your nswwitch is configured you should get

#nslookup
looking up files in /etc/hosts

Then type

server

you will get

default name server

www.hp.com
Name server:
Address:

Trying DNS
Addresses:

Give it a go

Steve
take your time and think things through

Re: nslookup doing nothing

Ok everything works well now, thanks everybody

My config :

/etc/resolv.conf
domain
search
nameserver A.B.C.D
nameserver E.F.G.H

/etc/nsswitch.conf
hosts: files [NOTFOUND=continue] dns


My problem was that the nameserver A.B.C.D was down when I was doing my config, and I didn't notice it. I pur for the moment E.F.G.H (2nd DNS server) as first DNS. Everything works well.

2 questions :

- Is the domain mandatory in /etc/resolv.conf ?


- How can I reduce the timeout value between the 2 DNS servers ? Actually, if the 1st DNS server is down, it tries for a few minutes before trying the secondary DNS server. I would like to configure 5/10 seconds.
Darrick Schuch
New Member

Re: nslookup doing nothing

The domainname line is not needed when using the "search" directive. You should however put your working domain first then list the other(s). On the timeout issue check out document KBRC00007792 in the knowledge base. That should help.
Sanjay_6
Honored Contributor

Re: nslookup doing nothing

Hi,

Try this,

/etc/nsswitch.conf file,

hosts : files [NOTFOUND=continue] dns

/etc/resolv.conf file,

search your_domain.com
nameserver a.b.c.d
nameserver e.f.g.h

Now do a nslookup,

nslookup
> server1 (exist in /etc/hosts file)
> server2 (does not exist in /etc/hosts but exists in DNS)
> exit

Hope this helps.

Regds