Command Dump – One line method to find errors in a large list of bind zone files

September 28, 2016

I have found need to go through a large list of bind zone files and find any that have errors.

This loop helps me identify them:

for a in `ls db.*.*|grep -v db.local.`; do named-checkzone localhost $a 2>&1 >/tmp/tmp; if [ "$?" != "0" ]; then echo "ERROR ON:$a"; cat /tmp/tmp; fi; done|more