How to restore cPanel DNS zone files from backup

If your cPanel is setup for daily backups and you accidentally deleted a DNS zone or need to restore one for a client, all your DNS zone backup files are stored here:

/backup/cpbackup/daily/dirs/_var_named

This is assuming you have your backup mounted to /backup

Now you can either copy over whatever file you need or you can copy the entire folder if you need to restore all DNS zones.

These files need to be moved to /var/named

Once you move the backup copy over to /var/named you need to change ownership of the files to named.named, for that we will use chown.

 

 

Now that changed permissions for everything in the /var/named folder. There are a few files that need to be owned by root though.

For that use chown again, here are the files/folders for root:named ownership.

 

 

Once you get all your ownership settings correct we will need to restart named, so

 

 

or

After we restart named we will want to rebuild the DNS configuration inside cPanel, so run this command:

 

 

That should do it! Verify all your files loaded in WHM and check with a DNS script, you can find one here: http://dns.hostt.net

Myles

Orlando, FL

Did this post help you?

Give back and rate it for me!

Related Posts

  • V. Ivanov

    Great, right to the point. Thanks a lot.