The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to change default TTL

Discussion in 'Bind / DNS / Nameserver Issues' started by akust0m, Apr 3, 2016.

Tags:
  1. akust0m

    akust0m Active Member

    Joined:
    Feb 19, 2016
    Messages:
    44
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Melbourne
    cPanel Access Level:
    Root Administrator
    Hello,

    I see that the default zone TTL is governed by the variable %ttl% and the NS TTL is governed by %nsttl%. Both of these appears to be set to 14400. It also appears that automatically generated TXT records also have a default TTL of 14400.

    Is there a way to change the value of %ttl% and %nsttl% and the TXT default TTL's? Or do I simply change these variables to a static value that I desire in the zone templates?

    Code:
    ; cPanel %cpversion%
    ; Zone file for %domain%
    $TTL %ttl%
    @      %nsttl%    IN      SOA     %nameserver%. %rpemail%. (
            %serial%    ; serial, todays date+todays
            3600        ; refresh, seconds
            7200        ; retry, seconds
            1209600        ; expire, seconds
            3600 )        ; minimum, seconds
    
    %domain%. %nsttl% IN NS %nameserver%.
    %domain%. %nsttl% IN NS %nameserver2%.
    %domain%. %nsttl% IN NS %nameserver3%.
    %domain%. %nsttl% IN NS %nameserver4%.
    
    %nameserverentry%. IN A %nameservera%
    %nameserverentry2%. IN A %nameservera2%
    %nameserverentry3%. IN A %nameservera3%
    %nameserverentry4%. IN A %nameservera4%
    
    %domain%. IN A %ip%
    %domain%. IN AAAA %ipv6%
    
    %domain%. IN MX 0 %domain%.
    
    mail IN CNAME %domain%.
    www IN CNAME %domain%.
    ftp IN A %ftpip%
    ftp IN AAAA %ipv6%
    
     
  2. iso99

    iso99 Well-Known Member

    Joined:
    Jan 5, 2011
    Messages:
    87
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Try Basic cPanel & WHM setup. The default 14400 is there.

    If that's not what you're looking for, I think the default Zone templates are a good start.
     
  3. akust0m

    akust0m Active Member

    Joined:
    Feb 19, 2016
    Messages:
    44
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Melbourne
    cPanel Access Level:
    Root Administrator
    Hi @iso99

    Thank you! That has helped. The last thing I want to fix is the default TTL for TXT records. They still seem to get the default 14400.

    Any ideas?
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,447
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    In WHM, search tool top left corner, type in TTL, to get to the settings for TTL here:
    Home »DNS Functions »Set Zone Time To Live (TTL)
     
  5. hrace009

    hrace009 Well-Known Member

    Joined:
    Dec 24, 2013
    Messages:
    68
    Likes Received:
    8
    Trophy Points:
    8
    Location:
    Root
    cPanel Access Level:
    Root Administrator
    Twitter:
    It will only set currently domain and subdomain, when you create new domain, it will keep to 14400, evently we already set it at Basic cPanel & WHM setup, it will keep 14400 for new domain.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    649
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you let us know how you are adding the TXT record? It's following the configured value under "WHM Home » Server Configuration » Basic WebHost Manager® Setup" when creating an account on a test system:

    Code:
    # grep TTL /etc/wwwacct.conf
    NSTTL 14405
    TTL 14406
    
    Thank you.
     
Loading...

Share This Page