nslookup command line non-interactive

So the man page on nslookup says, "Options can also be specified on the command line if they precede the arguments and are prefixed with a hyphen."

So I should be able to run this at the command line:

shell> nslookup -type=MX 208.64.252.230

However this doesn't return the MX record.  Instead it returns the A record per output below.

Without using interactive mode, how do I get nslookup to return the MX record?

PS. An answer that says, "Here's how you use dig to get the MX record" isn't an answer, that would be too easy.  I'm specifically after nslookup here.
shell> nslookup -type=MX 208.64.252.230
Server:         129.250.35.250
Address:        129.250.35.250#53

Non-authoritative answer:
230.252.64.208.in-addr.arpa     name = www.t1shopper.com.

Authoritative answers can be found from:
252.64.208.in-addr.arpa nameserver = NS1.USCOLO.com.
252.64.208.in-addr.arpa nameserver = NS3.USCOLO.com.

Open in new window

Geoff MillikanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fbcbloodcenterCommented:
nslookup -querytype=MX t1shopper.com
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shauncroucherCommented:
mx records relate to domain names, not ip addresses.

shaun
0
Geoff MillikanAuthor Commented:
fbcbloodcenter: Nope, that doesn't work, see below.

shauncroucher: Not sure what your point has to do with the question?
shell> nslookup -querytype=TXT 208.64.252.230

Server:         129.250.35.250
Address:        129.250.35.250#53

Non-authoritative answer:
230.252.64.208.in-addr.arpa     name = www.t1shopper.com.

Authoritative answers can be found from:
252.64.208.in-addr.arpa nameserver = NS1.USCOLO.com.
252.64.208.in-addr.arpa nameserver = NS3.USCOLO.com.

Open in new window

0
Webinar: Miercom Evaluates Wi-Fi Security

It's not just about Wi-Fi connectivity anymore. A wireless security breach can cost your business large amounts of time, trouble, and expense. Plus, hear first-hand from Miercom how WatchGuard's Wi-Fi security stacks up against the competition in our upcoming webinar!

shauncroucherCommented:
Well, you wrote:

"So I should be able to run this at the command line:

shell> nslookup -type=MX 208.64.252.230"

And the answer is no, that should not work because you are trying to find the MX record for an IP address, and this is not a legal lookup, IP's don't have MX records, domains do.

The answer that fbcbloodcenter gave is the correct use and does return the right result.

The code snippet seems to be looking for a TXT record for the IP address, which again, isn't going to return.

Shaun
0
fbcbloodcenterCommented:
shauncrouchers further explanation of my answer is correct. The query does work for me otherwise I would not have posted it.
0
Geoff MillikanAuthor Commented:
shauncroucher & fbcbloodcenter: You guys are totally right!  I'm so sorry, I must have been on another planet.  Thank you for the additional assistance setting me straight.
shell> nslookup -querytype=MX t1shopper.com
Server:         129.250.35.250
Address:        129.250.35.250#53

Non-authoritative answer:
t1shopper.com   mail exchanger = 10 www.t1shopper.com.

Authoritative answers can be found from:
t1shopper.com   nameserver = ns2.secure.net.
t1shopper.com   nameserver = ns1.secure.net.
www.t1shopper.com       internet address = 208.64.252.230
ns1.secure.net  internet address = 192.220.124.10
ns2.secure.net  internet address = 192.220.125.10

Open in new window

0
Geoff MillikanAuthor Commented:
Good answer!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DNS

From novice to tech pro — start learning today.