Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there a way to search the entire forward lookup zone in Windows 2008 R2 DNS server?

I would like to search both the NAME and the RDATA of all the resource records for a substring.

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

You can use dnscmd to enumerate records in a zone.

dnscmd /enumrecords mydomain.com @

You can then search the output of that for your string(s).

dnscmd /enumrecords mydomain.com @ | find "somestring"

or dump it to a file and parse the file with whatever tool you like

dnscmd /enumrecords mydomain.com @ > mydomain_enum.txt

There's a good article on doing something similar here.

And, as voretaq points out, yes it does work with non-AD-integrated zones.

share|improve this answer
1  
I'm pretty sure that would work for non-AD-Integrated zones too... –  voretaq7 Aug 17 '11 at 16:27
add comment

For an AD-Integrated zone you should be able to do this via an LDAP search. I'm not sure about the LDAP schema MS uses, but it's going to involve a filter something like (|(name=???)(rrdata=???)) -- I'm almost certain they don't use name and rrdata but substitute appropriately.

For non-integrated zones it may be easier to dump the zone file in BIND format and grep through it, or trigger an AXFR and grep through that. I'm not aware of anything in the Windows tools that lets you do a substring search.
Of course the last time I touched Windows DNS tools Win2K was The New Hotness On The Block so my knowledge is a little stale…

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.