Solved

How to check the mx record for multiple domains

Posted on 2010-11-29
6
3,941 Views
Last Modified: 2015-08-25
I have the need to check the mx record for multiple domains (100+) on a montly basis to ensrue that the mx record has not changed. I can go to any of several web sites that allow me to check the mx, but I can only check one at at time which is time consuming. Is there a tool I can use that will allow me to enter multiple domains to retrieve the mx information all at one time? Thanks!
0
Comment
Question by:myester
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Expert Comment

by:patrickfreer
ID: 34233928
you could script it with the following commands - though you'd need to go through the output manually:

nslookup
set type=mx
first.domain.name
second.domain.name
etc etc

Output all this to a text file and peruse at your leisure.
0
 

Author Comment

by:myester
ID: 34234616
Thanks for the reply Patrick. Could you give me an example of how this would be done? Would I do this via a batch file?
0
 
LVL 26

Expert Comment

by:DrDave242
ID: 34234926
If you use a batch file, you have to run nslookup in non-interactive mode, like so:
nslookup -q=mx domain1.com
nslookup -q=mx domain2.com
nslookup -q=mx domain3.com

Open in new window

You can save that as a batch file, then run it from a command prompt and send the output to a text file (i. e., checkmx.bat > c:\temp\mxoutput.txt).  You'll still have to pick through that text file manually unless you can write a Perl script or something to parse it for you...and I've forgotten way too much Perl to remember how to do that without a lot of digging.  :)
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 

Accepted Solution

by:
myester earned 0 total points
ID: 34240285
After some searching I found the following batch file information that works great:

@echo off
REM Check MX records of each domain listed in text file domainlist.txt
REM Report all MX records back into log.txt and any that contain the word
REM messagelabs into the file found.txt

set log=log.txt
del %log%

set find=messagelabs
set found=found.txt

for /f "tokens=*" %%a in ('type domainlist.txt') do (
  echo Checking "%%a."
  nslookup -type=MX %%a. 2>NUL | find "MX" >> %log%
)

start "Full list" notepad %log%

find /i "%find%" < %log% >%found%
start "Part list" notepad %found%
0
 

Author Closing Comment

by:myester
ID: 34276728
I found the solution on my own.
0
 

Expert Comment

by:Deepakanddeepak
ID: 40947406
Dear Sir,

We have no command over scripting can u please send the video for this issue. It will so helpful for me.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will assume you are running a non-server version of some sort of Windows throughout this article. There are many flavors of Windows since Windows Server 2000 - 2008, XP Home & Pro, Vista Home & Pro, and Windows 7 Starter, Home, Pro, Ultimate, etc.…
One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question