I'll need to count all the records in a dns server 2008, for all the zones configured on the server, by running a script locally
you can use dig to achieve this but you must allow zone tranfers on the dns server for the ip address of the machine where you run dig.
have a look at: http://docstore.mik.ua/orelly/networking_2ndEd/dns/ch12_09.htm
Running locally on the machine, this Powershell one-liner might do the trick:
...although it will probably include all the root hints, AD-specific entries and cached lookups, too.