1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

INWX: support MxNull records (#2700)

Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
Gert Van Gool
2023-12-08 08:58:24 -08:00
committed by GitHub
parent 3b6643b12d
commit cd371c1149
2 changed files with 10 additions and 4 deletions

View File

@ -11,8 +11,6 @@ import (
func AuditRecords(records []*models.RecordConfig) []error {
a := rejectif.Auditor{}
a.Add("MX", rejectif.MxNull) // Last verified 2020-12-28
a.Add("SRV", rejectif.SrvHasNullTarget) // Last verified 2020-12-28
a.Add("TXT", rejectif.TxtHasBackticks) // Last verified 2021-03-01

View File

@ -180,7 +180,11 @@ func makeNameserverRecordRequest(domain string, rec *models.RecordConfig) *goinw
req.Content = content[:len(content)-1]
case "MX":
req.Priority = int(rec.MxPreference)
req.Content = content[:len(content)-1]
if content == "." {
req.Content = content
} else {
req.Content = content[:len(content)-1]
}
case "SRV":
req.Priority = int(rec.SrvPriority)
req.Content = fmt.Sprintf("%d %d %v", rec.SrvWeight, rec.SrvPort, content[:len(content)-1])
@ -305,7 +309,11 @@ func (api *inwxAPI) GetZoneRecords(domain string, meta map[string]string) (model
"PTR": true,
}
if rtypeAddDot[record.Type] {
record.Content = record.Content + "."
if record.Type == "MX" && record.Content == "." {
// null records don't need to be modified
} else {
record.Content = record.Content + "."
}
}
rc := &models.RecordConfig{