1834804 Members
2343 Online
110070 Solutions
New Discussion

Nslookup Qeustion

 
SILO Storagetek
Frequent Advisor

Nslookup Qeustion

Hi everybody,
I've a strange situation using nslookup.
It works correctrly, but when I try to do "set type=MX" it doesn't work, and I recive an error: "*** Invalid option: type=MX"

any suggest?

Thansk
P.M.
12 REPLIES 12
Stefan Farrelly
Honored Contributor

Re: Nslookup Qeustion

Theres been a fair few patches for nslookup. It works fine on our servers. Have you got the latest ?

eg. for 11i its PHNE_28450

Go to the itrc home page, then individual patches, then HP-UX and search for "Bind" (as it includes nslookup)
Im from Palmerston North, New Zealand, but somehow ended up in London...
Steven E. Protter
Exalted Contributor

Re: Nslookup Qeustion

I have just run the same command against a Microsoft DNS server and a HP-UX DNS server and gotten a coreect response.

Though it appears counter intuitive, I would suspect there is no valid mx record on the DNS server.

Please verify and get back to us.

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
SILO Storagetek
Frequent Advisor

Re: Nslookup Qeustion

From my pc and from a 10.20 system I have no problems, the mx is present. Now I'll try with patch.
SILO Storagetek
Frequent Advisor

Re: Nslookup Qeustion

Hi,
I've installed the PHNE_28450, but nothing changes.

P.M.
Massimo Bianchi
Honored Contributor

Re: Nslookup Qeustion

Hi,
please post a

what $(which nslookup)

Massimo
SILO Storagetek
Frequent Advisor

Re: Nslookup Qeustion

Here my what:

what $(which nslookup)
/usr/bin/nslookup:
Copyright (c) 1985,1989 Regents of the University of California.
nslookup $Revision: 1.1.213.3 $ Fri Jan 17 05:28:43 GMT 2003 PHNE_28450

thanks..
P.M.
Massimo Bianchi
Honored Contributor

Re: Nslookup Qeustion

Hi,
you said that from your PC and from 10.20 works O.K.... just to be sure, are you questioning the same name server ?

Try issuing a nslookup with the " -swdebug" just to eliminate the possibility that someone put some wrong statement in the ~/.nslookuprc file.

HTH,
Massimo
Shannon Petry
Honored Contributor

Re: Nslookup Qeustion

Most of the time I see things like this, it's a MS Craptive directory issue, not Unix. Do you have another DNS server that is a known good you can try?

If not, use a friends server?

Regards,
Shannon
Microsoft. When do you want a virus today?
SILO Storagetek
Frequent Advisor

Re: Nslookup Qeustion

well.. thanks for help, I found the solution:
launching nslookup in system in wich it works, the query are on dns, but in all other system the output is: Using /etc/hosts on: sys_name

so, server dns_name and everything goes ok.

My question now is: I've the /etc/nsswitch.conf with files notfound continue dns, why it doesn't work in this case?

thanks everybody.
Massimo Bianchi
Honored Contributor

Re: Nslookup Qeustion

Hi,
are you sure that /etc/resolv.conf is O.K. ?
What is its content ?


You didn't even mention the "trying DNS" that will appear after the host resarch failed...

Massimo
Steve Cameron_1
New Member

Re: Nslookup Qeustion

From the nslookup man page: "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)."

I get the same results:
[HostName:/] nslookup
Using /etc/hosts on: HostName

> set type=MX
*** Invalid option: type=MX
> help
NAME - print address information about NAME
IP-ADDRESS - print hostname information about IP-ADDRESS
policy - print switch policy information
server NAME - set default server to NAME, using current default server
lserver NAME - set default server to NAME, using initial server
set OPTION - sets the OPTION
all - print options, current server and host
[no]swtrace - print lookup result and lookup switch messages
> server yahoo.com
Specifying a server has overridden the switch policy order.
The reset command will reinstate the order specified by the switch policy.
Default Name Server: yahoo.com
Address: 66.218.71.198

> set type=MX
> help
Commands: (identifiers are shown in uppercase, [] means optional)
NAME - print info about the host/domain NAME using default server
NAME1 NAME2 - as above, but use NAME2 as server
exit - exit the program, ^D also exits
finger [USER] - finger the optional NAME at the current default host
help or ? - print info on common commands; see nslookup(1) for details
ls [opt] DOMAIN [> FILE] - list addresses in DOMAIN (optional: output to FILE)
-a - list canonical names and aliases
-h - list HINFO (CPU type and operating system)
-s - list well-known services
-d - list all records
-t TYPE - list records of the given type (e.g., A,CNAME,MX, etc.)
policy - print switch policy information
root - set current default server to the root
server NAME - set default server to NAME, using current default server
lserver NAME - set default server to NAME, using initial server
reset - lookups use the switch policy; resets DNS servers
set OPTION - set an option
all - print options, current server and host
[no]debug - print debugging information
[no]d2 - print exhaustive debugging information
[no]defname - append domain name to each query
[no]swtrace - print source lookup and source switch messages
[no]recurse - ask for recursive answer to query
[no]vc - always use a virtual circuit
domain=NAME - set default domain name to NAME
srchlist=N1[/N2/.../N6] - set domain to N1 and search list to N1,N2, etc.
root=NAME - set root server to NAME
retry=X - set number of retries to X
timeout=X - set time-out interval to X
querytype=X - set query type, e.g., A,ANY,CNAME,HINFO,MX,NS,PTR,SOA,WKS
type=X - synonym for querytype
class=X - set query class to one of IN (Internet), CHAOS, HESIOD or ANY
view FILE - sort an 'ls' output file and view it with more
> exit


So, it looks like you're gettin' "Invalid..." 'cause you're using /etc/hosts (which makes sense - /etc/hosts doesn't contain any MX records). Specifying a server allows an MX search (at least, that's the way it looks and works for me)
Todd Whitcher
Esteemed Contributor

Re: Nslookup Qeustion

Hi,

I'f you have HP's BIND 9.2 you can use dig which is much more flexible than nslookup. If you don't have that version you can find dig out on the public domain for HPUX.

Example:
dig @dns_server yahoo.com MX
DiG named 9.2.0 <<>> @dns_server yahoo.com MX
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32009
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 5, ADDITIONAL: 15

;; QUESTION SECTION:
;yahoo.com. IN MX

;; ANSWER SECTION:
yahoo.com. 7022 IN MX 1 mx2.mail.yahoo.com.
yahoo.com. 7022 IN MX 5 mx4.mail.yahoo.com.
yahoo.com. 7022 IN MX 1 mx1.mail.yahoo.com.

;; AUTHORITY SECTION:
yahoo.com. 126421 IN NS ns1.yahoo.com.
yahoo.com. 126421 IN NS ns2.yahoo.com.
yahoo.com. 126421 IN NS ns3.yahoo.com.
yahoo.com. 126421 IN NS ns4.yahoo.com.
yahoo.com. 126421 IN NS ns5.yahoo.com.

;; ADDITIONAL SECTION:
mx2.mail.yahoo.com. 645 IN A 64.157.4.78
mx2.mail.yahoo.com. 645 IN A 64.157.4.82
mx2.mail.yahoo.com. 645 IN A 64.156.215.5
mx4.mail.yahoo.com. 810 IN A 66.218.86.254
mx4.mail.yahoo.com. 810 IN A 66.218.86.253
mx4.mail.yahoo.com. 810 IN A 216.136.129.5
mx4.mail.yahoo.com. 810 IN A 216.136.129.17
mx1.mail.yahoo.com. 1426 IN A 64.156.215.6
mx1.mail.yahoo.com. 1426 IN A 64.157.4.78
mx1.mail.yahoo.com. 1426 IN A 64.156.215.5
ns1.yahoo.com. 35740 IN A 66.218.71.63
ns2.yahoo.com. 29231 IN A 66.163.169.170
ns3.yahoo.com. 28321 IN A 217.12.4.104
ns4.yahoo.com. 30095 IN A 63.250.206.138
ns5.yahoo.com. 28464 IN A 216.109.116.17

;; Query time: 14 msec
;; SERVER: 15.51.240.8#53(www.atl.hp.com)
;; WHEN: Thu Jul 10 05:26:10 2003
;; MSG SIZE rcvd: 422

You can Get HP BIND 9.2 at software.hp.com

You can get a public domain version for hpux of dig here:

http://hpux.ee.ualberta.ca/hppd/hpux/Networking/Admin/dig-2.0/