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

DS: More cleanups

This commit is contained in:
Tom Limoncelli
2020-05-30 10:50:03 -04:00
parent a89ab89ab6
commit c0354a585d
3 changed files with 25 additions and 5 deletions

View File

@@ -169,6 +169,8 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) {
if label == "@" {
check(fmt.Errorf("cannot create CNAME record for bare domain"))
}
case "DS":
check(checkTarget(target))
case "MX":
check(checkTarget(target))
case "NS":
@@ -186,7 +188,7 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) {
check(checkTarget(target))
case "SRV":
check(checkTarget(target))
case "TXT", "IMPORT_TRANSFORM", "CAA", "SSHFP", "TLSA", "DS":
case "TXT", "IMPORT_TRANSFORM", "CAA", "SSHFP", "TLSA":
default:
if rec.Metadata["orig_custom_type"] != "" {
// it is a valid custom type. We perform no validation on target
@@ -316,7 +318,7 @@ func ValidateAndNormalizeConfig(config *models.DNSConfig) (errs []error) {
}
// Canonicalize Targets.
if rec.Type == "CNAME" || rec.Type == "MX" || rec.Type == "NAPTR" || rec.Type == "NS" || rec.Type == "SRV" {
if rec.Type == "CNAME" || rec.Type == "DS" || rec.Type == "MX" || rec.Type == "NAPTR" || rec.Type == "NS" || rec.Type == "SRV" {
// #rtype_variations
// These record types have a target that is a hostname.
// We normalize them to a FQDN so there is less variation to handle. If a