From 1a84edbe9cfe1e25fe6bc5ba71f700b0c8879afa Mon Sep 17 00:00:00 2001 From: Tom Limoncelli Date: Fri, 21 Jul 2017 16:52:54 -0400 Subject: [PATCH] RecordConfig.String() doesn't handle MX or TXT records properly. --- models/dns.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/models/dns.go b/models/dns.go index 93bc9843c..689ad3192 100644 --- a/models/dns.go +++ b/models/dns.go @@ -82,11 +82,12 @@ func (r *RecordConfig) String() (content string) { return r.Target } + content = fmt.Sprintf("%s %s %s %d", r.Type, r.NameFQDN, r.Target, r.TTL) switch r.Type { - case "A", "AAAA", "PTR": - content = fmt.Sprintf("%s %s %s %d", r.Type, r.NameFQDN, r.Target, r.TTL) + case "A", "AAAA", "PTR", "TXT": + // case "MX": - content = fmt.Sprintf(" priority=%d", r.MxPreference) + content += fmt.Sprintf(" priority=%d", r.MxPreference) case "SOA": content = fmt.Sprintf("%s %s %s %d", r.Type, r.Name, r.Target, r.TTL) default: