mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-09-05 20:54:22 +08:00
DNSMADEEASY: always override NS records TTL to be 86400 (#1317)
Fixes broken integration tests and spamming output about chaning NS records TTL from fixed one (86400) to dnscontrol default one (300). This issue was introduced in #1167. Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
parent
531aa6e313
commit
e3cd40a1a8
2 changed files with 7 additions and 4 deletions
|
@ -73,10 +73,13 @@ func (api *dnsMadeEasyProvider) GetDomainCorrections(dc *models.DomainConfig) ([
|
|||
return nil, err
|
||||
}
|
||||
|
||||
// ALIAS is called ANAME on DNS Made Easy
|
||||
for _, rec := range dc.Records {
|
||||
if rec.Type == "ALIAS" {
|
||||
// ALIAS is called ANAME on DNS Made Easy
|
||||
rec.Type = "ANAME"
|
||||
} else if rec.Type == "NS" {
|
||||
// NS records have fixed TTL on DNS Made Easy and it cannot be changed
|
||||
rec.TTL = fixedNameServerRecordTTL
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,9 @@ import (
|
|||
"github.com/StackExchange/dnscontrol/v3/models"
|
||||
)
|
||||
|
||||
// DNS Made Easy does not allow the system name servers to be edited, and said records appear to always have a fixed TTL of 86400.
|
||||
const fixedNameServerRecordTTL = 86400
|
||||
|
||||
type singleDomainResponse struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
|
@ -188,9 +191,6 @@ func fromRecordConfig(rc *models.RecordConfig) *recordRequestData {
|
|||
}
|
||||
|
||||
func systemNameServerToRecordConfig(domain string, nameServer string) *models.RecordConfig {
|
||||
// DNS Made Easy does not allow the system name servers to be edited, and said records appear to always have a fixed TTL of 86400.
|
||||
const fixedNameServerRecordTTL = 86400
|
||||
|
||||
target := nameServer + "."
|
||||
return toRecordConfig(domain, &recordResponseDataEntry{Type: "NS", Value: target, TTL: fixedNameServerRecordTTL})
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue