mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00: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:
@ -73,10 +73,13 @@ func (api *dnsMadeEasyProvider) GetDomainCorrections(dc *models.DomainConfig) ([
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// ALIAS is called ANAME on DNS Made Easy
|
|
||||||
for _, rec := range dc.Records {
|
for _, rec := range dc.Records {
|
||||||
if rec.Type == "ALIAS" {
|
if rec.Type == "ALIAS" {
|
||||||
|
// ALIAS is called ANAME on DNS Made Easy
|
||||||
rec.Type = "ANAME"
|
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"
|
"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 {
|
type singleDomainResponse struct {
|
||||||
ID int `json:"id"`
|
ID int `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
@ -188,9 +191,6 @@ func fromRecordConfig(rc *models.RecordConfig) *recordRequestData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func systemNameServerToRecordConfig(domain string, nameServer string) *models.RecordConfig {
|
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 + "."
|
target := nameServer + "."
|
||||||
return toRecordConfig(domain, &recordResponseDataEntry{Type: "NS", Value: target, TTL: fixedNameServerRecordTTL})
|
return toRecordConfig(domain, &recordResponseDataEntry{Type: "NS", Value: target, TTL: fixedNameServerRecordTTL})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user