diff --git a/providers/ns1/ns1provider.go b/providers/ns1/ns1provider.go index 40d87f98c..4588c3353 100644 --- a/providers/ns1/ns1provider.go +++ b/providers/ns1/ns1provider.go @@ -133,7 +133,9 @@ func buildRecord(recs models.Records, domain string, id string) *dns.Record { Zone: domain, } for _, r := range recs { - if r.Type == "TXT" { + if r.Type == "MX" { + rec.AddAnswer(&dns.Answer{Rdata: strings.Split(fmt.Sprintf("%d %v", r.MxPreference, r.GetTargetField()), " ")}) + } else if r.Type == "TXT" { rec.AddAnswer(&dns.Answer{Rdata: r.TxtStrings}) } else if r.Type == "SRV" { rec.AddAnswer(&dns.Answer{Rdata: strings.Split(fmt.Sprintf("%d %d %d %v", r.SrvPriority, r.SrvWeight, r.SrvPort, r.GetTargetField()), " ")})