AUTODNS: fix error when restoring existing MX or SRV records (#3492)

This commit is contained in:
arnoschoon 2025-03-18 16:52:14 +01:00 committed by GitHub
parent 0d8dcea63a
commit eec0f4952f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -247,8 +247,11 @@ func toRecordConfig(domain string, record *ResourceRecord) (*models.RecordConfig
}
rc.SetLabel(record.Name, domain)
if err := rc.PopulateFromString(record.Type, record.Value, domain); err != nil {
return nil, err
// special record types are handled below, skip the `rc.PopulateFromString` method
if record.Type != "MX" && record.Type != "SRV" {
if err := rc.PopulateFromString(record.Type, record.Value, domain); err != nil {
return nil, err
}
}
if record.Type == "MX" {