Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 down vote accepted

You can use dnscmd to enumerate records in a zone.

dnscmd /enumrecords @

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

dnscmd /enumrecords @ | find "somestring"

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

dnscmd /enumrecords @ > 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
I'm pretty sure that would work for non-AD-Integrated zones too... – voretaq7 Aug 17 '11 at 16:27

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

Your Answer


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.