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.

Change TTL on multiple DNS Zones?

Discussion in 'Bind / DNS / Nameserver Issues' started by HostIt, Mar 3, 2008.

  1. HostIt

    HostIt Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    Some time ago I changed a lot of DNS Zones to use a very short TTL during a site moving process. This allowed me to move a lot of sites without any downtime. Problem is, as a hangover from this I now have a whole lot of sites still using a very short TTL. Does anybody have a sure-fire way to reset everything back to the standard TTL of 14400 without risk?
     
  2. viraj

    viraj Well-Known Member

    Joined:
    Sep 28, 2006
    Messages:
    209
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    You can mass replace the TTL entries within all of your zone files by using this syntax :

    where "$TTL xxxxx" is your current setup TTL. :rolleyes:
     
  3. HostIt

    HostIt Well-Known Member

    Joined:
    Feb 22, 2003
    Messages:
    151
    Likes Received:
    1
    Trophy Points:
    18
    Sorry, I should have been more specific.

    I am trying to change the TTL for pretty much every zone and every record within the zone on an entire server i.e. everything that should have been set to 14400 ("www" A record for example) has been set to low TTL times like 60. The problem with doing a simple 'replace' for everything in that instance comes when a client has a subdomain, domain or IP address in their zone containing "60" for example.

    I'd imagine my best bet is to use DNS::ZoneParse to read and update every zone file, but I was hopeful there was existing code available somewhere. I may just have to code up something myself though.
     
Loading...

Share This Page