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

CLOUDNS: Implement PTR Record Support (#999)

* Add PTR support for ClouDNS

* Implement PTR Support for CLouDNS

Co-authored-by: IT-Sumpfling <it-sumpfling@maxit-con.de>
Co-authored-by: bentaybi jamal <jamal@pfalzcloud.de>
This commit is contained in:
taybinakh
2020-12-22 19:32:00 +01:00
committed by GitHub
parent c89f14e926
commit e9f4257ad2
5 changed files with 13 additions and 6 deletions

View File

@@ -15,7 +15,7 @@ import (
/*
CloDNS API DNS provider:
Info required in `creds.json`:
- auth-id
- auth-id or sub-auth-id
- auth-password
*/
@@ -26,7 +26,7 @@ func NewCloudns(m map[string]string, metadata json.RawMessage) (providers.DNSSer
c.creds.id, c.creds.password, c.creds.subid = m["auth-id"], m["auth-password"], m["sub-auth-id"]
if (c.creds.id == "" && c.creds.subid == "") || c.creds.password == "" {
return nil, fmt.Errorf("missing ClouDNS auth-id and auth-password")
return nil, fmt.Errorf("missing ClouDNS auth-id or sub-auth-id and auth-password")
}
// Get a domain to validate authentication
@@ -46,7 +46,7 @@ var features = providers.DocumentationNotes{
providers.CanUseSSHFP: providers.Can(),
providers.CanUseCAA: providers.Can(),
providers.CanUseTLSA: providers.Can(),
providers.CanUsePTR: providers.Unimplemented(),
providers.CanUsePTR: providers.Can(),
providers.CanGetZones: providers.Can(),
}
@@ -193,7 +193,7 @@ func toRc(domain string, r *domainRecord) *models.RecordConfig {
switch rtype := r.Type; rtype { // #rtype_variations
case "TXT":
rc.SetTargetTXT(r.Target)
case "CNAME", "MX", "NS", "SRV", "ALIAS":
case "CNAME", "MX", "NS", "SRV", "ALIAS", "PTR":
rc.SetTarget(dnsutil.AddOrigin(r.Target+".", domain))
case "CAA":
caaFlag, _ := strconv.ParseUint(r.CaaFlag, 10, 32)