mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2025-10-06 03:46:34 +08:00
NS1: add warning for deprecated record (#3078)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
parent
fe7370b9a6
commit
1a3d6a37bb
1 changed files with 2 additions and 0 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
|
|
||||||
"github.com/StackExchange/dnscontrol/v4/models"
|
"github.com/StackExchange/dnscontrol/v4/models"
|
||||||
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
"github.com/StackExchange/dnscontrol/v4/pkg/diff2"
|
||||||
|
"github.com/StackExchange/dnscontrol/v4/pkg/printer"
|
||||||
"github.com/StackExchange/dnscontrol/v4/providers"
|
"github.com/StackExchange/dnscontrol/v4/providers"
|
||||||
"gopkg.in/ns1/ns1-go.v2/rest"
|
"gopkg.in/ns1/ns1-go.v2/rest"
|
||||||
"gopkg.in/ns1/ns1-go.v2/rest/model/dns"
|
"gopkg.in/ns1/ns1-go.v2/rest/model/dns"
|
||||||
|
@ -338,6 +339,7 @@ func buildRecord(recs models.Records, domain string, id string) *dns.Record {
|
||||||
strconv.Itoa(int(r.DsDigestType)),
|
strconv.Itoa(int(r.DsDigestType)),
|
||||||
r.DsDigest}})
|
r.DsDigest}})
|
||||||
} else if r.Type == "NS1_URLFWD" {
|
} else if r.Type == "NS1_URLFWD" {
|
||||||
|
printer.Warnf("NS1_URLFWD is deprecated and may stop working anytime now. Please avoid such records going forward.\n")
|
||||||
rec.Type = "URLFWD"
|
rec.Type = "URLFWD"
|
||||||
rec.AddAnswer(&dns.Answer{Rdata: strings.Fields(r.GetTargetField())})
|
rec.AddAnswer(&dns.Answer{Rdata: strings.Fields(r.GetTargetField())})
|
||||||
} else if r.Type == "SVCB" || r.Type == "HTTPS" {
|
} else if r.Type == "SVCB" || r.Type == "HTTPS" {
|
||||||
|
|
Loading…
Add table
Reference in a new issue