From bb88b7c4b0f403cf5568e99d91142ad936d17d9f Mon Sep 17 00:00:00 2001 From: momoterraw Date: Fri, 27 Jan 2023 05:15:22 -0800 Subject: [PATCH] CLOUDFLARE: sometime ago they bump down the min ttl to 60 second (#1988) --- documentation/providers/cloudflareapi.md | 6 +++--- providers/cloudflare/cloudflareProvider.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/providers/cloudflareapi.md b/documentation/providers/cloudflareapi.md index cb554bd2e..bc30dd9a9 100644 --- a/documentation/providers/cloudflareapi.md +++ b/documentation/providers/cloudflareapi.md @@ -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. diff --git a/providers/cloudflare/cloudflareProvider.go b/providers/cloudflare/cloudflareProvider.go index d1a7dfc21..e0be04078 100644 --- a/providers/cloudflare/cloudflareProvider.go +++ b/providers/cloudflare/cloudflareProvider.go @@ -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" {