Command Line Modify TTL

Is there a command to modify the ttl from the command line. I want to lower the ttl on all domains.

Status: 
Closed (fixed)

Comments

This isn't possible yet in Virtualmin 3.85, but in the uncoming 3.86 release you will be able to do it from the command line with a command like :

virtualmin modify-dns --all-domains --ttl 2h

When will that be available. What would be the best way to lower the ttl on all the domains right now? It's kind of time sensitive.

Virtualmin enters the default TTL at the beginning of each zone file. So you'd have to edit the files /var/lib/bind/domainname.hosts (depending on distro the location might differ, this one is for Ubuntu) and modify the $TTL line for the default, and the number right after the hostname for individual records (which is missing if the default is used).

Also the number after the SOA line -- this is the zone's serial number -- must be increased, otherwise the zone is not recognized as having been changed.

If you have a lot of zones, you can probably whip up some script using a for command and the sed tool to modify all the files at once.

After changing the zones, you need to restart BIND or have it reload its full config.

For newly created virtual servers, you can edit the default TTL in the server template, section "BIND DNS Domain".

Joe's picture
Submitted by Joe on Thu, 06/02/2011 - 19:35 Pro Licensee

3.86 is very likely to be in the repos tonight or tomorrow.

Automatically closed -- issue fixed for 2 weeks with no activity.