Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Change TTL in all domains

Discussion in 'General Discussion' started by jmginer, Jul 12, 2019.

Tags:
  1. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. nixuser

    nixuser Well-Known Member

    Joined:
    May 30, 2014
    Messages:
    135
    Likes Received:
    30
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hmm.. seems like they removed it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,482
    Likes Received:
    508
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #4 jmginer, Jul 13, 2019
    Last edited: Jul 13, 2019
  5. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,482
    Likes Received:
    508
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    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)'}
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    verdon likes this.
  6. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    905
    Likes Received:
    8
    Trophy Points:
    168
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    That's handy. You would then also need to re-start bind I imagine?
     
  7. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,482
    Likes Received:
    508
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    You certainly could though it's not mandatory.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    verdon likes this.
  8. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    905
    Likes Received:
    8
    Trophy Points:
    168
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Good to know!
     
  9. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  10. LucasRolff

    LucasRolff Well-Known Member

    Joined:
    May 27, 2013
    Messages:
    64
    Likes Received:
    49
    Trophy Points:
    18
    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 :)
     
    #10 LucasRolff, Jul 15, 2019
    Last edited: Jul 15, 2019
    cPanelLauren likes this.
  11. jmginer

    jmginer Well-Known Member

    Joined:
    Jul 26, 2006
    Messages:
    128
    Likes Received:
    1
    Trophy Points:
    168
    Location:
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice