diff --git a/.goreleaser.yml b/.goreleaser.yml index bd06019bb..4cfbbcd0b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -39,7 +39,7 @@ changelog: regexp: "(?i)^.*(major|new provider|feature)[(\\w)]*:+.*$" order: 1 - title: 'Provider-specific changes:' - regexp: "(?i)((akamaiedge|autodns|axfrd|azure|azure_private_dns|bind|bunnydns|cloudflare|cloudflareapi_old|cloudns|cscglobal|desec|digitalocean|dnsimple|dnsmadeeasy|doh|domainnameshop|dynadot|easyname|exoscale|gandi|gcloud|gcore|hedns|hetzner|hexonet|hostingde|huaweicloud|inwx|linode|loopia|luadns|msdns|mythicbeasts|namecheap|namedotcom|netcup|netlify|ns1|opensrs|oracle|ovh|packetframe|porkbun|powerdns|realtimeregister|route53|rwth|sakuracloud|softlayer|transip|vultr).*:)+.*" + regexp: "(?i)((akamaiedge|autodns|axfrd|azure|azure_private_dns|bind|bunnydns|cloudflare|cloudflareapi_old|cloudns|cnr|cscglobal|desec|digitalocean|dnsimple|dnsmadeeasy|doh|domainnameshop|dynadot|easyname|exoscale|gandi|gcloud|gcore|hedns|hetzner|hexonet|hostingde|huaweicloud|inwx|linode|loopia|luadns|msdns|mythicbeasts|namecheap|namedotcom|netcup|netlify|ns1|opensrs|oracle|ovh|packetframe|porkbun|powerdns|realtimeregister|route53|rwth|sakuracloud|softlayer|transip|vultr).*:)+.*" order: 2 - title: 'Documentation:' regexp: "(?i)^.*(docs)[(\\w)]*:+.*$" diff --git a/documentation/SUMMARY.md b/documentation/SUMMARY.md index ca0a31a2f..55c8babf4 100644 --- a/documentation/SUMMARY.md +++ b/documentation/SUMMARY.md @@ -112,6 +112,7 @@ * [Azure Private DNS](provider/azure_private_dns.md) * [BIND](provider/bind.md) * [Bunny DNS](provider/bunny\_dns.md) +* [CentralNic Reseller (fka RRPproxy)](provider/cnr.md) * [Cloudflare](provider/cloudflareapi.md) * [ClouDNS](provider/cloudns.md) * [CSC Global](provider/cscglobal.md) diff --git a/documentation/providers.md b/documentation/providers.md index 5d386c8b3..cdae731e9 100644 --- a/documentation/providers.md +++ b/documentation/providers.md @@ -23,7 +23,7 @@ If a feature is definitively not supported for whatever reason, we would also li | [`BUNNY_DNS`](provider/bunny_dns.md) | ❌ | ✅ | ❌ | ❌ | ✅ | ✅ | ❌ | ❔ | ❌ | ❌ | ✅ | ❌ | ✅ | ❌ | ❔ | ❌ | ❌ | ❌ | ❔ | ❔ | ❌ | ✅ | ✅ | | [`CLOUDFLAREAPI`](provider/cloudflareapi.md) | ✅ | ✅ | ❌ | ✅ | ✅ | ✅ | ❔ | ✅ | ❌ | ✅ | ✅ | ❔ | ✅ | ✅ | ✅ | ✅ | ❔ | ❔ | ❔ | ❌ | ❌ | ✅ | ✅ | | [`CLOUDNS`](provider/cloudns.md) | ❌ | ✅ | ❌ | ✅ | ✅ | ✅ | ✅ | ❔ | ✅ | ❔ | ✅ | ❔ | ✅ | ✅ | ❔ | ✅ | ❔ | ❔ | ✅ | ❔ | ❔ | ✅ | ✅ | -| [`CNR`](provider/cnr.md) | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ❔ | ❔ | ❔ | ❔ | ✅ | ❔ | ✅ | ❔ | ❔ | ✅ | ❔ | ❔ | ❔ | ❔ | ✅ | ✅ | ✅ | +| [`CNR`](provider/cnr.md) | ❌ | ✅ | ✅ | ✅ | ❌ | ✅ | ❔ | ❌ | ❌ | ✅ | ✅ | ❌ | ✅ | ✅ | ❌ | ✅ | ❔ | ❌ | ❌ | ❔ | ✅ | ✅ | ✅ | | [`CSCGLOBAL`](provider/cscglobal.md) | ✅ | ✅ | ✅ | ✅ | ❔ | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❌ | ✅ | | [`DESEC`](provider/desec.md) | ❌ | ✅ | ❌ | ✅ | ❔ | ✅ | ✅ | ✅ | ❔ | ✅ | ✅ | ❔ | ✅ | ✅ | ✅ | ✅ | ✅ | ❔ | ❔ | ✅ | ❔ | ✅ | ✅ | | [`DIGITALOCEAN`](provider/digitalocean.md) | ❌ | ✅ | ❌ | ✅ | ❔ | ✅ | ❔ | ❔ | ❌ | ❔ | ❔ | ❔ | ✅ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ❔ | ✅ | ✅ | @@ -118,6 +118,7 @@ Providers in this category and their maintainers are: |[`BUNNY_DNS`](provider/bunny_dns.md)|@ppmathis| |[`CLOUDFLAREAPI`](provider/cloudflareapi.md)|@tresni| |[`CLOUDNS`](provider/cloudns.md)|@pragmaton| +|[`CNR`](provider/cnr.md)|@KaiSchwarz-cnic| |[`CSCGLOBAL`](provider/cscglobal.md)|@Air-New-Zealand| |[`DESEC`](provider/desec.md)|@D3luxee| |[`DIGITALOCEAN`](provider/digitalocean.md)|@Deraen| @@ -172,7 +173,6 @@ code to support this provider, we'd be glad to help in any way. * [Infoblox DNS](https://github.com/StackExchange/dnscontrol/issues/1077) (#1077) * [Joker.com](https://github.com/StackExchange/dnscontrol/issues/854) (#854) * [Plesk](https://github.com/StackExchange/dnscontrol/issues/2261) (#2261) -* [RRPPRoxy](https://github.com/StackExchange/dnscontrol/issues/1656) (#1656) * [RcodeZero](https://github.com/StackExchange/dnscontrol/issues/884) (#884) * [SynergyWholesale](https://github.com/StackExchange/dnscontrol/issues/1605) (#1605) * [UltraDNS by Neustar / CSCGlobal](https://github.com/StackExchange/dnscontrol/issues/1533) (#1533) diff --git a/providers/cnr/cnrProvider.go b/providers/cnr/cnrProvider.go index 8318d40db..5debd3f08 100644 --- a/providers/cnr/cnrProvider.go +++ b/providers/cnr/cnrProvider.go @@ -25,19 +25,35 @@ type CNRClient struct { } var features = providers.DocumentationNotes{ - // The default for unlisted capabilities is 'Cannot'. // See providers/capabilities.go for the entire list of capabilities. - providers.CanGetZones: providers.Can(), + // The default for unlisted capabilities is 'Cannot'. + // --- Supported Features --- + providers.CanAutoDNSSEC: providers.Unimplemented("Ask for this feature."), providers.CanConcur: providers.Can(), - providers.CanUseAlias: providers.Cannot("Not supported. You may use CNAME records instead. An Alternative solution is planned."), - providers.CanUseCAA: providers.Can(), - providers.CanUseLOC: providers.Unimplemented(), - providers.CanUsePTR: providers.Can(), - providers.CanUseSRV: providers.Can("SRV records with empty targets are not supported"), - providers.CanUseTLSA: providers.Can(), + providers.CanGetZones: providers.Can(), providers.DocCreateDomains: providers.Can(), providers.DocDualHost: providers.Can(), providers.DocOfficiallySupported: providers.Cannot("Actively maintained provider module."), + // --- Supported record types --- + // providers.CanUseAKAMAICDN: providers.Cannot(), // can only be supported by Akamai EdgeDns provider + providers.CanUseAlias: providers.Cannot("Not supported. You may use CNAME records instead. An Alternative solution is planned."), + // providers.CanUseAzureAlias: providers.Cannot(), // can only be supported by Azure provider + providers.CanUseCAA: providers.Can(), + providers.CanUseDHCID: providers.Cannot("Ask for this feature."), + providers.CanUseDNAME: providers.Cannot("Ask for this feature."), + providers.CanUseDNSKEY: providers.Unimplemented("Ask for this feature."), + providers.CanUseDS: providers.Unimplemented("Ask for this feature."), + providers.CanUseDSForChildren: providers.Unimplemented("Ask for this feature."), // CanUseDS implies CanUseDSForChildren + providers.CanUseHTTPS: providers.Cannot("Managed via (Query|Add|Modify|Delete)WebFwd API call. Data not accessible via the resource records list. Hard to integrate this into DNSControl by that."), + providers.CanUseLOC: providers.Cannot("Ask for this feature."), + providers.CanUseNAPTR: providers.Can(), + providers.CanUsePTR: providers.Can(), + // providers.CanUseRoute53Alias: providers.Cannot(), // can only be supported by AWS Route53 provider + providers.CanUseSOA: providers.Cannot("The SOA record is managed on the DNSZone directly. Data only accessible via StatusDNSZone Request, not via the resource records list. Hard to integrate this into DNSControl by that."), // supported by bind, honstingde + providers.CanUseSRV: providers.Can("SRV records with empty targets are not supported"), + providers.CanUseSSHFP: providers.Can(), + providers.CanUseSVCB: providers.Cannot("Ask for this feature."), + providers.CanUseTLSA: providers.Can(), } func newProvider(conf map[string]string) (*CNRClient, error) { @@ -47,7 +63,7 @@ func newProvider(conf map[string]string) (*CNRClient, error) { } api.client.SetUserAgent("DNSControl", version) api.APILogin, api.APIPassword, api.APIEntity = conf["apilogin"], conf["apipassword"], conf["apientity"] - if conf["debugmode"] == "1" { + if conf["debugmode"] == "2" { api.client.EnableDebugMode() } if api.APIEntity != "OTE" && api.APIEntity != "LIVE" { diff --git a/providers/cnr/records.go b/providers/cnr/records.go index bfe5d8fcd..5a931b5f1 100644 --- a/providers/cnr/records.go +++ b/providers/cnr/records.go @@ -195,7 +195,10 @@ func (n *CNRClient) getRecords(domain string) ([]*CNRRecord, error) { if r.GetCode() == 545 { // If dns zone does not exist create a new one automatically if !isNoPopulate() { - n.EnsureZoneExists(domain) + err := n.EnsureZoneExists(domain) + if err != nil { + return nil, err + } } else { // Return specific error if the zone does not exist return nil, n.GetCNRApiError("Use `dnscontrol create-domains` to create not-existing zone", domain, r) @@ -293,6 +296,16 @@ func (n *CNRClient) createRecordString(rc *models.RecordConfig, domain string) ( if domain == host { host = fmt.Sprintf(`%s.`, host) } + case "SSHFP": + answer = fmt.Sprintf(`%v %v %s`, rc.SshfpAlgorithm, rc.SshfpFingerprint, rc.GetTargetField()) + if domain == host { + host = fmt.Sprintf(`%s.`, host) + } + case "NAPTR": + answer = fmt.Sprintf(`%v %v "%v" "%v" "%v" %v`, rc.NaptrOrder, rc.NaptrPreference, rc.NaptrFlags, rc.NaptrService, rc.NaptrRegexp, rc.GetTargetField()) + if domain == host { + host = fmt.Sprintf(`%s.`, host) + } case "TLSA": answer = fmt.Sprintf(`%v %v %v %s`, rc.TlsaUsage, rc.TlsaSelector, rc.TlsaMatchingType, rc.GetTargetField()) case "CAA": @@ -363,5 +376,5 @@ func isNoPopulate() bool { // Function to check if debug mode is enabled func (n *CNRClient) isDebugOn() bool { - return n.conf["debugmode"] == "1" + return n.conf["debugmode"] == "1" || n.conf["debugmode"] == "2" }