Operating System - HP-UX
1825578 Members
2215 Online
109682 Solutions
New Discussion

Strange error in nslookup

 
SOLVED
Go to solution
Igor I. Shulz
Frequent Advisor

Strange error in nslookup

Hmm. This is hosts line in nsswitch.conf:

hosts: files [NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]

When I try to get MX-info from nslookup, I get the next error:

> set query=MX
*** Invalid option: query=MX

If I set dns as first choice in hosts line in nsswitch.conf, nslookup works fine with MX-option, but I'd like to have hosts-file to be first choice in nsswitch. What is wrong.

On other my servers hosts-file is first choice, but nslookup takes MX-option without promlems.

13 REPLIES 13
Victor Fridyev
Honored Contributor

Re: Strange error in nslookup

Hi,

This is right behaviour for HPUX. If you try to do the same in LINUX, even if file is in the beginning in /etc/nsswitch.conf, everything will work.

Regards
Entities are not to be multiplied beyond necessity - RTFM
Victor Fridyev
Honored Contributor

Re: Strange error in nslookup

Sorry, forgot to mention that if you want to see MX-records, you can set server in nslookup:

nslookup
>server {IP|hostname}
>set q=mx


HTH
Entities are not to be multiplied beyond necessity - RTFM
Igor I. Shulz
Frequent Advisor

Re: Strange error in nslookup

But!!!

This is another server HPUX 11.11, and all works fine:

# cat /etc/nsswitch.conf
hosts: files [NOTFOUND=continue UNAVAIL=continue] dns [NOTFOUND=return UNAVAIL=continue TRYAGAIN=return]
# nslookup
> set query=MX
> mail.com
Server: 172.24.131.127
Address: 172.24.131.127#53

Non-authoritative answer:
mail.com mail exchanger = 10 mail-com.mr.outblaze.com.
mail.com mail exchanger = 20 mail-com-bk.mr.outblaze.com.

Authoritative answers can be found from:
mail.com nameserver = ns1.portal2.com.
mail.com nameserver = ns1.outblaze.com.
ns1.portal2.com internet address = 203.86.166.3
ns1.outblaze.com internet address = 205.158.62.40
>
Victor Fridyev
Honored Contributor

Re: Strange error in nslookup

Sorry, no idea 8((((

On my hpux11.11 servers with the same configuration set q=mx does not work.

Regards
Entities are not to be multiplied beyond necessity - RTFM
Sameer_Nirmal
Honored Contributor

Re: Strange error in nslookup

Hi,

It seems that the "nslookup" is not accepting the DNS specific option saying "invalid option" as "dns" is the second source (after 'files"). It expect the "dns" should be the first option.

You can cross check between the systems,the versions of "BIND" and "nslookup" installed using
# what /usr/sbin/named
# what /usr/bin/nslookup

Depending on the HP-UX OS version, you can install the latest BIND patch.
Muthukumar_5
Honored Contributor

Re: Strange error in nslookup

Exchange server setting will be looking dns settings only. It will not use files. Try to set hosts: entry as,

hosts: dns files

--
Muthu
Easy to suggest when don't know about the problem!
Bejoy C Alias
Respected Contributor

Re: Strange error in nslookup

Check what is the default settings after loading nslookup .

# nslookup
> set all

and see whether there is a default server option set or blank. if this option contains a server address then the 'set query=mx' should work . compare the default settings on both the servers.
Be Always Joy ......
Steven E. Protter
Exalted Contributor
Solution

Re: Strange error in nslookup

Shalom,

With hpux this option will not work. It has to do with the nslookup they provide.

With a Linux or windows host it works.

In this limited case you might wish to get your information from one of those systems.

If you must do it from HP-UX you may wish to install BIND 9.2 and explore the dig command.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Arunvijai_4
Honored Contributor

Re: Strange error in nslookup

Hello,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=967934

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Steven E. Protter
Exalted Contributor

Re: Strange error in nslookup

Seems its not nslookup on all versions of HP-UX.

Could be 11.00

There must be a patch somewhere for this.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steven E. Protter
Exalted Contributor

Re: Strange error in nslookup

nslookup is not considered secure and may some day be deprecated. I don't know if I will be deprecated before nslookup or not.

If you wish to follow this thread's adviced:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=967934

Install depot BIND from here. It includes dig
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=BIND9.2

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com

Re: Strange error in nslookup

MX lookup on hpux (tried it on 11.11) :

# nslookup -type=mx blabla.com
Using /etc/hosts on: myserver

looking up FILES
Trying DNS
Non-authoritative answer:
blabla.com preference = 10, mail exchanger = blamail.blabla.com

Authoritative answers can be found from:
blamail.blabla.com internet address = 192.168.1.1
welliton
New Member

Re: Strange error in nslookup

cu