[Feature Request] Allow setting individual TTL values for DNS records (API)

websafe

Verified User
Joined
Jun 15, 2010
Messages
103
Location
Opole, PL
It would be great to have the ability of setting individual TTL values for each record in a DNS zone.

Example: I need a single A record in a zone with a short TTL (300) which is changed
frequently (via API) but I want all other records in this zone to have the default TTL (14400).

Currently this is not really possible without some "dirty hacking" and not possible
at all if we want to update the record only remotely via DA API.

With this feature we could easily update our zone remotely via API every time
for example our dynamic IP at the office changes (something like DynDNS, No-IP, etc.).
 
Hello,

Do you mean an individual TTL per record? Or per record type?

If per record type you can customize: /usr/local/directadmin/data/templates/named.db (first copy it to /usr/local/directadmin/data/templates/custom/)

Code:
|?SET_TTL=`DEFAULT_TTL`|
|?NS_TIME=`SET_TTL`|
|?A_TIME=`SET_TTL`|
|?MX_TIME=`SET_TTL`|
|?CNAME_TIME=`SET_TTL`|
|?PTR_TIME=`SET_TTL`|
|?TXT_TIME=`SET_TTL`|
|?AAAA_TIME=`SET_TTL`|
|?SRV_TIME=`SET_TTL`|
|?SPF_TIME=`SET_TTL`|
|?TLSA_TIME=`SET_TTL`|
|?CAA_TIME=`SET_TTL`|
|?DS_TIME=`SET_TTL`|
$TTL |SET_TTL|
@       IN      SOA     |NS1|      |EMAIL| (
                                                |SERIAL|
                                                |SET_TTL|
                                                3600
                                                1209600
                                                86400 )


|NS|
|A|
|MX|
|CNAME|
|PTR|
|TXT|
|AAAA|
|SRV|
|SPF|
|TLSA|
|CAA|
|DS|
 
Do you mean an individual TTL per record? Or per record type?


Hello zEitEr,

I mean an individual TTL per record, not per record type :-)

Sometimes you need to have a single A record with a very short TTL,
for example a VPN server on a dynamic IP, or maybe a very short TTL
for MX records (if you're planning to move the MX with a minimal "downtime").

Many scenarios would require this.

Personally I would be happy to have this option available via the API,
this would allow some of my customers, with a dynamic IP in their
office, to run (via cron) a script on their local server, that would update
a single A record in their zone (hosted on a DirectAdmin server)
so they wouldn't have to pay for DynDNS, No-IP or others.

Would be great to have an option to "increase" the zone serial via API too...
 
Looks promising, but I'm not sure if I understand if that will solve my problem:

If a domain as a ttl_override enabled, the override will do just that.. override any per-record settings.
This could be a quick way to reset all ttl values to a given value, if needed (then switch it back to the default ttl)

I would like to be able to setup INDIVIDUAL PER RECORD TTLs in a domain. And probably the most important part is doing thi via the Directadmin API....
 
Back
Top