Change TTL value of all domains

Change TTL value of all domains

Stop worrying about your server.

cPanel/Plesk Server Management for just $59/mo with Unlimited tickets, Unlimited admin hours, Security audits, 24×7 monitoring and lot more 

cPanel Server Management  $59/mo Click here

Plesk Server Management $59/mo Click here

Best practice to migrate website with less downtime is to change the TTL value to a lower one.

You can change the TTL of your domains from control panel Dns Manager

If you want to migrate too many domains it would be hard to change each domains TTL manually here is an easy way to change TTL of many domains

First backup all your DNS zone files

cp -rf /var/named /var/named_ttl_backup

No we have backup of all zone files under /var/named_ttl_backup

Lets change the TTL value of all domains under /var/named

Change directory to /var/named

cd /var/named

Suppose that your current TTL value is 14400 and we are going to change it to 3600

perl -pi -e ‘s/14400/3600/’ *.db

This command will change all the TTL value of domains from 14400 to 3600

Reload named service

rndc reload

We are done 🙂

Monthly server support with Unlimited tickets, 24×7 monitoring, Security Audit and lot more for just $59 

Server Management at just $59

Leave a Reply

Your email address will not be published. Required fields are marked *