mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-10-06 20:05:50 +08:00
AUTODNS: fix error when restoring existing MX or SRV records (#3492)
This commit is contained in:
parent
0d8dcea63a
commit
eec0f4952f
1 changed files with 5 additions and 2 deletions
|
@ -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" {
|
||||
|
|
Loading…
Add table
Reference in a new issue