Fixed MX records on NS1
@@ -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()), " ")})
