# # How do I look up an MX record with nslookup?
APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

How do I look up an MX record with nslookup?

I've removed advertising from most of this site and will eventually clean up the few pages where it remains.

While not terribly expensive to maintain, this does cost me something. If I don't get enough donations to cover that expense, I will be shutting the site down in early 2020.

If you found something useful today, please consider a small donation.



Some material is very old and may be incorrect today

© April 2015 Anthony Lawrence

Anonymous asks:

We have an application that sends out mail, but it isn't working right. It's sending local domain mail to the wrong server. I figure it must be getting the MX from local DNS, but how can I check that with nslookup?

I'd install Linux and use "dig" or "host", but I suppose that's asking a bit too much.

I couldn't remember how to use nslookup for that, so I invoked Google, which sent me to Using NSlookup.exe, which enlightened me with this less than ideal wisdom:


To look up different data types within the domain name space, use the set type or set q[uerytype] command at the command prompt. For example, to query for the mail exchanger data, type the following:


   C:\> nslookup
   Default Server:  ns1.domain.com
   Address:  10.0.0.1

   > set q=mx
   > mailhost
   Server:  ns1.domain.com
   Address:  10.0.0.1

   mailhost.domain.com     MX preference = 0, mail exchanger =
                           mailhost.domain.com
   mailhost.domain.com     internet address = 10.0.0.5
 

But that's not right. It's not wrong, but it assumes the user is trying to find out if a machine IS an MX, which is not what you want to know. For your question, you'd do:

   > set q=mx
   > domain-you-want-to-know-about
 

For example, if you wanted to know the MX for my domain, you'd type "aplawrence.com".

Looking up an MX record

Leave it to Microsoft to give the least likely usage as their example!


If you found something useful today, please consider a small donation.



Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> How do I look up an MX record with nslookup?


Inexpensive and informative Apple related e-books:

Take Control of Automating Your Mac

Take Control of OS X Server

Take Control of Pages

Take Control of IOS 11

Photos for Mac: A Take Control Crash Course





More Articles by © Anthony Lawrence





Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us


Printer Friendly Version





Some people, when confronted with a problem, think "I know, I'll use sed." Now they have two problems. (Jamie Zawinski)




Linux posts

Troubleshooting posts


This post tagged:

Forum

Microsoft

Troubleshooting



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode