I'm about to move servers and I want to lower the TTL value on all the domains in my WHM - there are about 100.
Is there any way of modifying all these at once, or am I going to have to edit each DNS zone manually?
Thanks
Andrew
I'm about to move servers and I want to lower the TTL value on all the domains in my WHM - there are about 100.
Is there any way of modifying all these at once, or am I going to have to edit each DNS zone manually?
Thanks
Andrew
When I need to do things like that, I just download the files, open them in a good text editor like cutehtml or notetabpro, and use search/replace, then upload the new files. Takes a total of about 5 minutes for 100 files.
If you prefer from shell, see this thread.
Thanks.Originally posted by squirrel
When I need to do things like that, I just download the files, open them in a good text editor like cutehtml or notetabpro, and use search/replace, then upload the new files. Takes a total of about 5 minutes for 100 files.
If you prefer from shell, see this thread.
Which files do I need to download though - all the named.db files?
Yes
Should be /var/named/[domain].db
Just make sure you upload and download in ascii not binary.
From shell:
(first, backup all of your files
then:
find /var/named -type f -exec \
sh -c 'gawk "$0" "$1" > "$1.tmp"; mv "$1.tmp" "$1"' \
'{gsub("oldvalue","newvalue"); print $0}' '{}' \;
Just replace oldvalue and newvalue with the appropriate values.
So, if you wanted to change "expire" from 3600000 to 600 .....
find /var/named -type f -exec \
sh -c 'gawk "$0" "$1" > "$1.tmp"; mv "$1.tmp" "$1"' \
'{gsub("3600000","600"); print $0}' '{}' \;
Thanks to you both.
Originally Posted by bamasbest
YOU ARE AWESOME!!![]()
how about:
replace '36000' '6000' -- *.db
Lots easier and command line. No script needed.
Lloyd F Tennison
Bear in mind that if you touch a zone file you should always increment the SERIAL number too.
Jonathan Michaelson
Need your cPanel servers secured and tuned?
cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
http://www.configserver.com