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

Add SRV Record Type (#136)

* Add support for SRV records for NAMEDOTCOM and ROUTE53.
* Improve docs
* Rename RR() to ToRR().
* Rename RecordConfig Priority to MxPreference (affects json IR data)
This commit is contained in:
Tom Limoncelli
2017-07-19 15:53:40 -04:00
committed by GitHub
parent 032750743c
commit d55b20ecdb
23 changed files with 351 additions and 161 deletions

View File

@@ -55,6 +55,7 @@ func validateRecordTypes(rec *models.RecordConfig, domain string, pTypes []strin
"CNAME": true,
"IMPORT_TRANSFORM": false,
"MX": true,
"SRV": true,
"TXT": true,
"NS": true,
"PTR": true,
@@ -96,7 +97,7 @@ func checkLabel(label string, rType string, domain string) error {
}
//underscores are warnings
if strings.ContainsRune(label, '_') {
if rType != "SRV" && strings.ContainsRune(label, '_') {
//unless it is in our exclusion list
ok := false
for _, ex := range expectedUnderscores {
@@ -146,6 +147,8 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) {
check(checkTarget(target))
case "ALIAS":
check(checkTarget(target))
case "SRV":
check(checkTarget(target))
case "TXT", "IMPORT_TRANSFORM":
default:
if rec.Metadata["orig_custom_type"] != "" {
@@ -203,7 +206,7 @@ func importTransform(srcDomain, dstDomain *models.DomainConfig, transforms []tra
r := newRec()
r.Target = transformCNAME(r.Target, srcDomain.Name, dstDomain.Name)
dstDomain.Records = append(dstDomain.Records, r)
case "MX", "NS", "TXT":
case "MX", "NS", "SRV", "TXT":
// Not imported.
continue
default: