Set NAPTR record to FQDN.

This commit is contained in:
Peter Dunaskin 2019-04-01 09:15:43 +02:00
parent e2726dda64
commit bb278caf92

View file

@ -171,11 +171,13 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) {
}
case "PTR":
check(checkTarget(target))
case "NAPTR":
check(checkTarget(target))
case "ALIAS":
check(checkTarget(target))
case "SRV":
check(checkTarget(target))
case "TXT", "IMPORT_TRANSFORM", "CAA", "NAPTR", "SSHFP", "TLSA":
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
@ -232,7 +234,7 @@ func importTransform(srcDomain, dstDomain *models.DomainConfig, transforms []tra
r := newRec()
r.SetTarget(transformCNAME(r.GetTargetField(), srcDomain.Name, dstDomain.Name))
dstDomain.Records = append(dstDomain.Records, r)
case "MX", "NS", "SRV", "TXT", "CAA", "TLSA":
case "MX", "NAPTR", "NS", "SRV", "TXT", "CAA", "TLSA":
// Not imported.
continue
default:
@ -300,7 +302,7 @@ func NormalizeAndValidateConfig(config *models.DNSConfig) (errs []error) {
}
// Canonicalize Targets.
if rec.Type == "CNAME" || rec.Type == "MX" || rec.Type == "NS" || rec.Type == "SRV" {
if rec.Type == "CNAME" || 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