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:
@@ -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:
|
||||
|
Reference in New Issue
Block a user