CLOUDFLARE: SPF records should be converted to TXT Fixes #446 (#480)

This commit is contained in:
Patrik Kernstock 2019-05-18 17:08:18 +02:00 committed by Tom Limoncelli
parent 6d6f685f70
commit d782bb002b
2 changed files with 10 additions and 0 deletions

View file

@ -6,6 +6,10 @@ jsId: CLOUDFLAREAPI
---
# Cloudflare Provider
## Important notes
* When using `SPF()` or the `SPF_BUILDER()` the records are converted to RecordType `TXT` as Cloudflare API fails otherwise. See more [here](https://github.com/StackExchange/dnscontrol/issues/446).
## Configuration
In the credentials file you must provide your Cloudflare API username and access token:

View file

@ -393,6 +393,12 @@ func (c *cfRecord) nativeToRecord(domain string) *models.RecordConfig {
Original: c,
}
rc.SetLabelFromFQDN(c.Name, domain)
// workaround for https://github.com/StackExchange/dnscontrol/issues/446
if c.Type == "SPF" {
c.Type = "TXT"
}
switch rType := c.Type; rType { // #rtype_variations
case "MX":
var priority uint16