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

Enable PTR records for BIND driver (#146)

* WIP

* Enable PTR records in dnsconfig.js, in BIND provider.

* Rename REVERSE() to REV().

* More accurate PTR target checking

* Document REV()

* Fix broken test
This commit is contained in:
Tom Limoncelli
2017-07-06 10:18:15 -04:00
committed by Craig Peterson
parent bce99a1c25
commit aa92817116
9 changed files with 135 additions and 55 deletions

View File

@@ -57,6 +57,7 @@ func validateRecordTypes(rec *models.RecordConfig, domain string, pTypes []strin
"MX": true,
"TXT": true,
"NS": true,
"PTR": true,
"ALIAS": false,
}
_, ok := validTypes[rec.Type]
@@ -141,6 +142,8 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) {
if label == "@" {
check(fmt.Errorf("cannot create NS record for bare domain. Use NAMESERVER instead"))
}
case "PTR":
check(checkTarget(target))
case "ALIAS":
check(checkTarget(target))
case "TXT", "IMPORT_TRANSFORM":
@@ -149,7 +152,7 @@ func checkTargets(rec *models.RecordConfig, domain string) (errs []error) {
//it is a valid custom type. We perform no validation on target
return
}
errs = append(errs, fmt.Errorf("Unimplemented record type (%v) domain=%v name=%v",
errs = append(errs, fmt.Errorf("checkTargets: Unimplemented record type (%v) domain=%v name=%v",
rec.Type, domain, rec.Name))
}
return