Re: nslookup and dnscmd help
- From: "Herb Martin" <news@xxxxxxxxxxxxxx>
- Date: Wed, 13 Sep 2006 03:27:13 -0500
"Microsoft" <me@xxxxxxxx> wrote in message
news:eUM3SnFzGHA.4580@xxxxxxxxxxxxxxxxxxxxxxx
This will list all records in all zones on your dns server. You'll get
several errors at the start but if you redirect this into a text file,
that will be easy enough to clean up.
for /f %a in ('dnscmd 10.0.0.1 /EnumZones') do dnscmd 10.0.0.1 /Zoneprint
%a
Sweet.
Here is the cleanup to get only MX records, use your redirect to
text file (and thus avoid any error messages too):
for /f %a in ('dnscmd 127.0.0.1 /EnumZones') do dnscmd 127.0.0.1 /Zoneprint
%a | findstr /R "\<MX\>" >>mx.txt
Those quotes around "\<MX\>" are necessary to avoid the Begin
Work < and End Word > being taken as (more) redirection.
This finds all records in all zones that have MX -- it could conceivable
mess up slightly if you had a server named MX.something.com or even
MX-123.something.com
(so don't do that <grin>)
Unfortunately it would also mess up if you zone were under the Mexico
hierarchy. <sigh>
But that could fixed by better Regular Expressions probably.
(You might need Grep or Awk to do that however.)
--
Herb Martin, MCSE, MVP
Accelerated MCSE
http://www.LearnQuick.Com
[phone number on web site]
"NoBoDy" <NoWaY@xxxxxxxxxxx> wrote in message
news:u7gOAZFyGHA.4392@xxxxxxxxxxxxxxxxxxxxxxx
Hello all
I am trying to list all MX records in all zones running on a dns server.
By using 'ls -t mx name of zone' from nslookup or 'dnscmd /enumrecords
name of zone . /type mx' from dnscmd I can get a list of all MX records
for a specific zone.
But how can I expand these commands to get a list of MX records for all
zones running on a dns server not just for a specific zone?
Regards
.
- Prev by Date: Re: removed DNS server and PC still resolves ?!?!
- Next by Date: Re: Standard DNS notifies.
- Previous by thread: Re: Protected Forest with One Child domain
- Next by thread: Re: Standard DNS notifies.
- Index(es):
Relevant Pages
|