mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-10-06 03:46:34 +08:00
RecordConfig.String() doesn't handle MX or TXT records properly.
This commit is contained in:
parent
caa71c4031
commit
1a84edbe9c
1 changed files with 4 additions and 3 deletions
|
@ -82,11 +82,12 @@ func (r *RecordConfig) String() (content string) {
|
||||||
return r.Target
|
return r.Target
|
||||||
}
|
}
|
||||||
|
|
||||||
|
content = fmt.Sprintf("%s %s %s %d", r.Type, r.NameFQDN, r.Target, r.TTL)
|
||||||
switch r.Type {
|
switch r.Type {
|
||||||
case "A", "AAAA", "PTR":
|
case "A", "AAAA", "PTR", "TXT":
|
||||||
content = fmt.Sprintf("%s %s %s %d", r.Type, r.NameFQDN, r.Target, r.TTL)
|
//
|
||||||
case "MX":
|
case "MX":
|
||||||
content = fmt.Sprintf(" priority=%d", r.MxPreference)
|
content += fmt.Sprintf(" priority=%d", r.MxPreference)
|
||||||
case "SOA":
|
case "SOA":
|
||||||
content = fmt.Sprintf("%s %s %s %d", r.Type, r.Name, r.Target, r.TTL)
|
content = fmt.Sprintf("%s %s %s %d", r.Type, r.Name, r.Target, r.TTL)
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue