CLOUDFLARE: sometime ago they bump down the min ttl to 60 second (#1988)

This commit is contained in:
momoterraw 2023-01-27 05:15:22 -08:00 committed by GitHub
parent 222f50d986
commit bb88b7c4b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -256,13 +256,13 @@ which as far as we can tell means 300 seconds (5 minutes) with the option that
CloudFlare may dynamically adjust the actual TTL. In the Cloudflare API,
setting the TTL to 300 results in the TTL being set to 1.
If the TTL isn't set to 1, Cloudflare has a minimum of 2 minutes.
If the TTL isn't set to 1, Cloudflare has a minimum of 1 minutes.
A TTL of 0 tells DNSControl to use the default TTL for that provider, which is 1.
In summary:
* TTL of 0, 1 and 300 are all the same ("auto TTL").
* TTL of 2-120 are all the same as 120.
* TTL of 121-299, and 301 to infinity are not magic.
* TTL of 2-60 are all the same as 60.
* TTL of 61-299, and 301 to infinity are not magic.
Some of this is documented on the Cloudflare website's [Time to Live (TTL)](https://developers.cloudflare.com/dns/manage-dns-records/reference/ttl/) page.

View file

@ -420,8 +420,8 @@ func (c *cloudflareProvider) preprocessConfig(dc *models.DomainConfig) error {
if rec.TTL == 0 || rec.TTL == 300 {
rec.TTL = 1
}
if rec.TTL != 1 && rec.TTL < 120 {
rec.TTL = 120
if rec.TTL != 1 && rec.TTL < 60 {
rec.TTL = 60
}
if rec.Type != "A" && rec.Type != "CNAME" && rec.Type != "AAAA" && rec.Type != "ALIAS" {