How to Search All Forward Lookup Names in Windows 2008 R2 DNS Server for a String

domain-name-systemwindows-server-2008

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.

Best Answer

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.

Related Topic