recover deleted bind db.* files using dig
DESCRIPTION
How to recover deleted bind db.* files using dig command.TRANSCRIPT
How to recover deletedbind zone files?
MethodsIf you accidentally delete /etc/bind/db.* files use one of the following methods for recovery
- Restore from latest backup- Use dig to retrieve records from memory- Use file recovery utility called ext3grep
Important: Do not restart bind service until you recover the zone files!
Using dnsutils (dig)1) Examine named.conf to see what zone files are available
cat /etc/bind/named.conf
2) Use dig with “advanced” options to format the output and save it to a filedig +nocmd +multiline +noadditional +noquestion \
+nostats +nocomments +nottlid localhost \ any | sed '1i $TTL 604800' > /etc/bind/db.local
3) Set proper file permissionschown root:bind /etc/bind/db.local
4) Reload named serviceservice named reload
Thank you!