1
0
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:
Vojta Drbohlav
2021-12-14 13:49:00 +01:00
committed by GitHub
parent 531aa6e313
commit e3cd40a1a8
2 changed files with 7 additions and 4 deletions

View File

@ -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
}
}

View File

@ -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})
}