Hello DNSControl fans!
This is another bugfix release. Only CLOUDFLAREAPI
is affected, and only the CF_REDIRECT
/CF_TEMP_REDIRECT
/CF_SINGLE_REDIRECT
commands are affected.
Some non-functional improvements are included in this release too. @cafferata contributed code that automatically generates the OWNERS
file, @nikolamilekic and @svenluijten fixed documentation bugs.
Cloudflare-related improvements:
CF_SINGLE_REDIRECT
rule name was not propagating to Cloudflare correctly. #3049CF_REDIRECT
/CF_TEMP_REDIRECT
rule name generated in conversion mode was long and ugly; now they are short and easier to identify. They are in the (1,302,when,then) format seen in preview
output.CF_SINGLE_REDIRECT
statements generated when CF_REDIRECT
/CF_TEMP_REDIRECT
is in conversion mode.Explanation of the new feature:
Suppose dnsconfig.js
includes a statement like:
D("example.com", ...
CF_TEMP_REDIR("https://example.com/*", "https://replacement.example.com/$1),
In the old days, CF_TEMP_REDIR
would generate a Cloudflare "page rule". However page rules are going away. Therefore, these will now be silently translated into CF_SINGLE_REDIRECT
statements when the manage_single_redirects
meta feature is set to true. A log of these translations can be generated by setting the transcode_log
variable:
var DSP_CLOUDFLARE = NewDnsProvider("cloudflare", {
"manage_single_redirects": true,
"transcode_log": "transcode.log",
});
Once set, any such translations will be appended to the filename transcode.log.
In this example, the log will look like this:
D("example.com", ...
CF_SINGLE_REDIRECT("1,302,https://example.com/*,https://replacement.example.com/$1",
302,
'http.host eq "example.com"',
'concat("https://replacement.example.com", http.request.uri.path)'
),
Replacing the old CF_TEMP_REDIR
statement with the above CF_SINGLE_REDIRECT
statement requires manual cutting and pasting.
While the CF_REDIRECT
/CF_TEMP_REDIRECT
statements are not going away, it is recommended that you convert to CF_SINGLE_REDIRECT
since they are more flexible and officially supported by Cloudflare.
This feature is documented in https://docs.dnscontrol.org/provider/cloudflareapi#old-style-vs-new-style-redirects
Warning
brew install dnscontrol
You can use the Docker image from Docker hub or GitHub Container Registry.
docker run --rm -it -v "$(pwd):/dns" ghcr.io/stackexchange/dnscontrol preview
Alternatively, you can install the latest binary (or the apt/rpm/deb/archlinux package) from this page.
Or, if you have Go installed, you can install the latest version of DNSControl with the following command:
go install github.com/StackExchange/dnscontrol/v4@main
Update to the latest version depends on how you choose to install dnscontrol
on your machine.
brew upgrade dnscontrol
Alternatively, you can grab the latest binary (or the apt/rpm/deb package) from this page.
—This release has 14 assets:
Visit the release page to download them.