1820592 Members
1748 Online
109626 Solutions
New Discussion юеВ

nslookup problem

 
SOLVED
Go to solution
Ralf Buchhold
Regular Advisor

nslookup problem

Hello
I have a problem on some machines:

ok is: nslookup server1
output: name: server1

fault:

nslookup server2
output: server2.xxx.yyy.de

where can I change this ?

Thanks
Ralf
11 REPLIES 11
Bharat Katkar
Honored Contributor

Re: nslookup problem

Update DNS entry for server1 on DNS server. COnfirm you are able to see DNS server as well.

Regards,
You need to know a lot to actually know how little you know
Muthukumar_5
Honored Contributor

Re: nslookup problem

hai,


Make an entry in /etc/resolve.conf as
domain xxx.yyy.de

or make an alias in /etc/hosts file


nslookup will process from /etc/nsswitch.conf file's hosts: etc entries.

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
KapilRaj
Honored Contributor

Re: nslookup problem

nsloookup directly queries nameservers defined in resolv.conf nothing else !

Can u post the name records set for these two server's ?. It may be from two diffrent nameservers ... !

Kaps
Nothing is impossible
Bharat Katkar
Honored Contributor

Re: nslookup problem

Yes,
rightly said by kapil, you need to check /etc/resolv.conf file of your system.
It looks like this:

domain abc.xyz.com
nameserver

Make sure server1 and server2 lies in same domain or else try adding domain of server1 and its DNS server IP address as above.

Hope that helps.
Regards,
You need to know a lot to actually know how little you know
Muthukumar_5
Honored Contributor
Solution

Re: nslookup problem

Hai,

nslookup command resolves ip-address or hostname using the hosts: tag entries in /etc/nsswitch.conf file.

make an entry in /etc/hosts as,
server1.xxx.yyy.de server1

if your file entry is at first.

else do that change in /etc/resolv.conf as,
domain xxx.yyy.de
nameserver

If your check nslookup

It will try to resolve using the nsswitch.conf file's hosts: entry.

Regards,
Muthukumar.


Easy to suggest when don't know about the problem!
KapilRaj
Honored Contributor

Re: nslookup problem

Muthu,

I am afraid ur statements are incorrect .. I can agree "gethostbyname" reads entries in nsswitch.conf not nslookup command. nslookup stands for Nameserver Lookup. So i am sure it will loook for a nameserver (bind).

Your statements are correct for commands like host,ping,telnet,ftp etc ... these commands internally call some functions which read entries from nsswitch.conf

Regds,

Kaps
Nothing is impossible
Muthukumar_5
Honored Contributor

Re: nslookup problem

hai kapil,

Thanks for your question. Let us start to get hostname resolvation with only file.

change your entry in /etc/nsswitch.conf as,
hosts: files

edit the /etc/hosts files as,


nslookup hostname

It will resolve your entries now without dns and any problem. It is orally specified in nslookup man page.

Regards,
Muthukumar.
Easy to suggest when don't know about the problem!
Jeff_Traigle
Honored Contributor

Re: nslookup problem

I have to agree with Muthitar on this one. From the man page and emperical evidence of using it over the years:

"By default, nslookup accesses name services for name and address resolution based on the policy information obtained from the switch configuration file /etc/nsswitch.conf When the policy is set to use NIS or /etc/hosts first, or when DNS is first but unavailable, then nslookup will only provide a limited command set (a help command while in this situation will show what actions are possible when querying NIS or /etc/hosts.) To override the switch policy and query DNS servers directly, the server command can be used to specify a nameserver. This same overriding of the switch policy can also be done by providing a nameserver as the second argument on the command line. In this case, nslookup will ignore the switch policy and directly query nameservers, until a reset command is issued."

The only time nslookup only queries DNS in HP-UX is if you specify the server on the command line or with the server command in interactive mode. This is unique to HP's implementation as far as I know... nslookup on Linux, for example, is strictly DNS lookup.
--
Jeff Traigle
Jeff_Traigle
Honored Contributor

Re: nslookup problem

And sorry I butchered your name in my post, Muthukumar.
--
Jeff Traigle
KapilRaj
Honored Contributor

Re: nslookup problem

Why do I think i am right always ?. apologies mate .. you are right.

I was checking on an aix node and later came to know that in aix the file is netsvc.conf and it is not very similier to nsswitch.conf.

Kaps
Nothing is impossible
Muthukumar_5
Honored Contributor

Re: nslookup problem

hai jeff traigle,

It is a nice and sincere analysis. Thanks for that to get more informations.

And Kapil, thanks to you to make jeff to give his nice analysis on this.
Easy to suggest when don't know about the problem!