Introduction
This article covers how to restore a DNS zone file from a cPanel backup.
Procedure
1) Backup /var/named.
cp -a /var/named{,-`date -I`}
2) Locate the backup zone.
The zone file will be located in the following locations on the server where DATE is the date the backup was created, ACCOUNT is the cPanel account, and DOMAIN.TLD is the domain. Note that the "Back up System Files" option will need to have been enabled during the backup for the first of these to be present.
/backup/DATE/system/dirs/_var_named.tar.gz - var/named/DOMAIN.TLD.db
/backup/DATE/accounts/ACCOUNT.tar.gz - ACCOUNT/dnszones/DOMAIN.TLD.db
3) Extract the zone file with one of the following commands.
tar -xvf /backup/DATE/system/dirs/_var_named.tar.gz var/named/DOMAIN.TLD.db
tar -xvf /backup/DATE/accounts/ACCOUNT.tar.gz ACCOUNT/dnszones/DOMAIN.TLD.db
4) Copy the extracted zone file to /var/named/ with one of the following commands.
cp -v var/named/cptest.com.db /var/named/
cp -v cptest/dnszones/cptest.com.db /var/named/
5) Restart named to load the zone.
/scripts/restartsrv_named
Comments
0 comments
Article is closed for comments.