Skip to content

Instantly share code, notes, and snippets.

@luelista
Created January 28, 2015 19:00
Show Gist options
  • Save luelista/238b73582293a5cf13cb to your computer and use it in GitHub Desktop.
Save luelista/238b73582293a5cf13cb to your computer and use it in GitHub Desktop.
Zone transfer to secondary name server via mysqldump...
zone.txt: last_change
pdnssec rectify-all-zones
echo "SELECT name,type,content from records;" | mysql pdns > new_zone.txt
diff zone.txt new_zone.txt > zone.diff
rm zone.txt
mv new_zone.txt zone.txt
gzip --stdout zone.diff > diffs/zone.diff.$(date +"%Y%m%d%H%M")
mysqldump pdns | ssh -i /root/.ssh/copydns_key ns3.teamwiki.net "mysql pdns"
# maybe you want this mailed or jabbered somewhere
# cat zone.diff | mail -s "Zone file changes" root
# jabber somebody@example.com "Zone file changes\n $(cat zone.diff)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment