mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-03-10 14:33:39 +08:00
Route53 uses a custom record type for SPF (#787)
Much like OVH Route53 when queried returns SPF records as their own
type. This small change transcribes the SPF type to TXT
See: https://github.com/StackExchange/dnscontrol/issues/446
See: 644ba70e87/providers/ovh/ovhProvider.go (L169-L172)
This commit is contained in:
parent
644ba70e87
commit
ea328263c7
1 changed files with 5 additions and 1 deletions
|
@ -377,10 +377,14 @@ func nativeToRecords(set *r53.ResourceRecordSet, origin string) []*models.Record
|
|||
switch rtype := *set.Type; rtype {
|
||||
case "SOA":
|
||||
continue
|
||||
case "SPF":
|
||||
// route53 uses a custom record type for SPF
|
||||
rtype = "TXT"
|
||||
fallthrough
|
||||
default:
|
||||
rc := &models.RecordConfig{TTL: uint32(*set.TTL)}
|
||||
rc.SetLabelFromFQDN(unescape(set.Name), origin)
|
||||
if err := rc.PopulateFromString(*set.Type, *rec.Value, origin); err != nil {
|
||||
if err := rc.PopulateFromString(rtype, *rec.Value, origin); err != nil {
|
||||
panic(fmt.Errorf("unparsable record received from R53: %w", err))
|
||||
}
|
||||
results = append(results, rc)
|
||||
|
|
Loading…
Reference in a new issue