Skip to content

Instantly share code, notes, and snippets.

@limed
Created March 14, 2012 22:21
Show Gist options
  • Save limed/2040016 to your computer and use it in GitHub Desktop.
Save limed/2040016 to your computer and use it in GitHub Desktop.
Does axfr from dns master and does a check-zone
#!/bin/bash
ARG=$1
MASTER="ns.example.com"
DEFAULT_ZONE=(example.com)
if [ -z ${ARG} ]; then
for i in ${DEFAULT_ZONE[@]}; do
echo "Testing zone ${i}..."
dig @${MASTER} ${i} -t axfr > /tmp/${i}.$$
named-checkzone -d ${i} /tmp/${i}.$$
echo ""
rm -f /tmp/${i}.$$
done
else
echo "Testing zone ${ARG}..."
dig @${MASTER} ${ARG} -t axfr > /tmp/${ARG}.$$
named-checkzone -d ${ARG} /tmp/${ARG}.$$
echo ""
rm -f /tmp/${ARG}.$$
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment