jmginer

Well-Known Member
Jul 26, 2006
159
7
168
Alicante
cPanel Access Level
Root Administrator
Hello, seems cPanel has removed the "check all" button on the TTL upgrade interface.

It's impossible to go one by one by hand when we have many.

How we can do now?

Thanks!
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
This hasn't changed in some time, just to double check I created a 76 server and checked and there's no option to select all there either.

There is also a feature request for this which can be found here: Bulk change/modify DNS Zone files
 

jmginer

Well-Known Member
Jul 26, 2006
159
7
168
Alicante
cPanel Access Level
Root Administrator
@cPanelLauren

Here I have a server 11.68 and I can select the first record, press the key shift of the keyboard and when I select the last record, all the records of the list are selected.

In the new versions, with the checkbox it is no longer possible.

Imagine how frustrating it is to have to edit the TTL of 600 domains by hand, one by one... Do you understand that this is impossible?

Now imagine that you have the TTL of all your domains defined at 300 seconds and that you are receiving DNS attacks... An option to reduce the requests is to increase the TTL, but there are 600 domains... do you understand the problem?

I hope you understand that we need to get back this feature you removed... I guess by mistake.

Thanks!

Screenshot_40.png
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
I understand the frustration and can see the merit in being able to select multiple. I'd again suggest the feature request if you must do this through the UI but there are most certainly simple ways to achieve this using the CLI. For example you could potentially use replace to do this for all zone records in /var/named. I took a couple of minutes to get this together for you:

Make backups of your zone files:
Code:
cp -rpf /var/named /var/named.backup
use replace to change the TTL:

Code:
replace "300" "14400" -- /var/named/*.db
update the serial:

Code:
grep "Serial Number" /var/named/*.db | sed "s/://g" | cut -d/ -f4 | awk {'system("replace "$2" "strftime("%Y%m%d")"00 -- /var/named/"$1)'}
 
  • Like
Reactions: verdon

jmginer

Well-Known Member
Jul 26, 2006
159
7
168
Alicante
cPanel Access Level
Root Administrator
I'm sorry, but your proposal is not acceptable.

That command will break any DNS record that includes the string "300", for example a domain that is as300.net will be renamed to as14400.net

And that is assuming that all domains have the TTL at 300, if each domain has a different TTL...

I can't believe it... You eliminate a functionality and to put it back into operation you ask me to vote for a feature...

And all this, after raising the price of licenses ...

This is totally unacceptable.
 

LucasRolff

Well-Known Member
Community Guide Contributor
May 27, 2013
142
95
78
cPanel Access Level
Root Administrator
@jmginer,

You can use /usr/local/cpanel/bin/set_zone_ttl to bulk update TTL for either a list of domains, a user or all domains in your DNS cluster.

If you want to update TTL for all users on a given server, you can do something like:

Code:
for user in $(ls /var/cpanel/users); do /usr/local/cpanel/bin/set_zone_ttl --user $user --newttl 60; done
You can pass --force if you don't want to confirm for every account :)

Edit: I'm more curious why you still have a v68 box around that has a root exploitable exim installation :)
 
Last edited:
  • Like
Reactions: cPanelLauren

jmginer

Well-Known Member
Jul 26, 2006
159
7
168
Alicante
cPanel Access Level
Root Administrator
Thank you very much @LucasRolff !!!!

Obviously I don't have any v68 server in production, but I have a snapshot of a pre-configured template and I was able to restore it just to provide the screenshot of my second response in this thread.
 

Bidi

Well-Known Member
Oct 3, 2012
118
15
68
Romania, Transilvania
cPanel Access Level
DataCenter Provider
Hello guys,

I read somewhere is good to set ttl to 300 if you whant to migrate websites/accounts to a new server, is this true ?

And is there a option to set ttl to 300 for the new accounts migrated on the new server till we move the ips two ?

For me i whant to migrate 300accounts to a new server but all the websites to be on the same ip like in older one

Chears
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,307
2,240
363
cPanel Access Level
Root Administrator
I usually go with 300, as that is 5 minutes, and set that up a few days before I plan to do a migration. That way the lowered TTL has time to propagate before I make any changes.

To change the default value, you'd want to go to the very first option in WHM, Basic WebHost Manager setup, and change the value next to this text to 300:

"This value defines the caching time for host name lookups for domains hosted on this server. When a caching nameserver queries the authoritative nameserver for a resource record, this value defines the number of seconds before the record will expire. Shorter TTL values can cause heavier loads on the nameserver, but can be useful for zones that contain frequently changing records. The range of values in seconds as defined by RFC 2181 is 0 to 2147483647."

That will change the value for any newly-created zones.