Skip to content

Commit

Permalink
NEW PROVIDER: Bunny DNS (StackExchange#2265) (StackExchange#2760)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppmathis authored Jan 6, 2024
1 parent 5daeafc commit 961eaa7
Show file tree
Hide file tree
Showing 15 changed files with 730 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/pr_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
Write-Host "Integration test providers: $Providers"
echo "integration_test_providers=$(ConvertTo-Json -InputObject $Providers -Compress)" >> $env:GITHUB_OUTPUT
env:
PROVIDERS: "['AZURE_DNS','BIND','CLOUDFLAREAPI','CLOUDNS','DIGITALOCEAN','GANDI_V5','GCLOUD','HEDNS','HEXONET','INWX','NAMEDOTCOM','NS1','POWERDNS','ROUTE53','TRANSIP']"
PROVIDERS: "['AZURE_DNS','BIND','BUNNY_DNS','CLOUDFLAREAPI','CLOUDNS','DIGITALOCEAN','GANDI_V5','GCLOUD','HEDNS','HEXONET','INWX','NAMEDOTCOM','NS1','POWERDNS','ROUTE53','TRANSIP']"
ENV_CONTEXT: ${{ toJson(env) }}
VARS_CONTEXT: ${{ toJson(vars) }}
SECRETS_CONTEXT: ${{ toJson(secrets) }}
Expand All @@ -106,6 +106,7 @@ jobs:
# Set it to the domain name to use during the test.
AZURE_DNS_DOMAIN: ${{ vars.AZURE_DNS_DOMAIN }}
BIND_DOMAIN: ${{ vars.BIND_DOMAIN }}
BUNNY_DNS_DOMAIN: ${{ vars.BUNNY_DNS_DOMAIN }}
CLOUDFLAREAPI_DOMAIN: ${{ vars.CLOUDFLAREAPI_DOMAIN }}
CLOUDNS_DOMAIN: ${{ vars.CLOUDNS_DOMAIN }}
CSCGLOBAL_DOMAIN: ${{ vars.CSCGLOBAL_DOMAIN }}
Expand All @@ -129,6 +130,8 @@ jobs:
AZURE_DNS_SUBSCRIPTION_ID: ${{ secrets.AZURE_DNS_SUBSCRIPTION_ID }}
AZURE_DNS_TENANT_ID: ${{ secrets.AZURE_DNS_TENANT_ID }}

BUNNY_DNS_API_KEY: ${{ secrets.BUNNY_DNS_API_KEY }}

CLOUDFLAREAPI_ACCOUNTID: ${{ secrets.CLOUDFLAREAPI_ACCOUNTID }}
CLOUDFLAREAPI_TOKEN: ${{ secrets.CLOUDFLAREAPI_TOKEN }}

Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,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|cloudflare|cloudflareapi_old|cloudns|cscglobal|desec|digitalocean|dnsimple|dnsmadeeasy|doh|domainnameshop|dynadot|easyname|exoscale|gandi|gcloud|gcore|hedns|hetzner|hexonet|hostingde|inwx|linode|loopia|luadns|msdns|mythicbeasts|namecheap|namedotcom|netcup|netlify|ns1|opensrs|oracle|ovh|packetframe|porkbun|powerdns|route53|rwth|softlayer|transip|vultr).*:)+.*"
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|inwx|linode|loopia|luadns|msdns|mythicbeasts|namecheap|namedotcom|netcup|netlify|ns1|opensrs|oracle|ovh|packetframe|porkbun|powerdns|route53|rwth|softlayer|transip|vultr).*:)+.*"
order: 2
- title: 'Documentation:'
regexp: "(?i)^.*(docs)[(\\w)]*:+.*$"
Expand Down
1 change: 1 addition & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ providers/axfrddns @hnrgrgr
providers/azuredns @vatsalyagoel
providers/azureprivatedns @matthewmgamble
providers/bind @tlimoncelli
providers/bunnydns @ppmathis
providers/cloudflare @tresni
providers/cloudns @pragmaton
providers/cscglobal @mikenz
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Currently supported DNS providers:
- Azure DNS
- Azure Private DNS
- BIND
- Bunny DNS
- Cloudflare
- ClouDNS
- deSEC
Expand Down
1 change: 1 addition & 0 deletions documentation/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
* [Azure DNS](providers/azure_dns.md)
* [Azure Private DNS](providers/azure_private_dns.md)
* [BIND](providers/bind.md)
* [Bunny DNS](providers/bunny_dns.md)
* [Cloudflare](providers/cloudflareapi.md)
* [ClouDNS](providers/cloudns.md)
* [CSC Global](providers/cscglobal.md)
Expand Down
3 changes: 2 additions & 1 deletion documentation/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ If a feature is definitively not supported for whatever reason, we would also li
| [`AZURE_DNS`](providers/azure_dns.md) ||||||||||||||||||||
| [`AZURE_PRIVATE_DNS`](providers/azure_private_dns.md) ||||||||||||||||||||
| [`BIND`](providers/bind.md) ||||||||||||||||||||
| [`BUNNY_DNS`](providers/bunny_dns.md) ||||||||||||||||||||
| [`CLOUDFLAREAPI`](providers/cloudflareapi.md) ||||||||||||||||||||
| [`CLOUDNS`](providers/cloudns.md) ||||||||||||||||||||
| [`CSCGLOBAL`](providers/cscglobal.md) ||||||||||||||||||||
Expand Down Expand Up @@ -110,6 +111,7 @@ Providers in this category and their maintainers are:
|[`AZURE_PRIVATE_DNS`](providers/azure_private_dns.md)|@matthewmgamble|
|[`AKAMAIEDGEDNS`](providers/akamaiedgedns.md)|@svernick|
|[`AXFRDDNS`](providers/axfrddns.md)|@hnrgrgr|
|[`BUNNY_DNS`](providers/bunny_dns.md)|@ppmathis|
|[`CLOUDFLAREAPI`](providers/cloudflareapi.md)|@tresni|
|[`CLOUDNS`](providers/cloudns.md)|@pragmaton|
|[`CSCGLOBAL`](providers/cscglobal.md)|@Air-New-Zealand|
Expand Down Expand Up @@ -154,7 +156,6 @@ code to support this provider, we'd be glad to help in any way.

* [1984 Hosting](https://github.com/StackExchange/dnscontrol/issues/1251) (#1251)
* [Alibaba Cloud DNS](https://github.com/StackExchange/dnscontrol/issues/420)(#420)
* [BunnyDNS](https://github.com/StackExchange/dnscontrol/issues/2265)(#2265)
* [Constellix (DNSMadeEasy)](https://github.com/StackExchange/dnscontrol/issues/842) (#842)
* [CoreDNS](https://github.com/StackExchange/dnscontrol/issues/1284) (#1284)
* [EU.ORG](https://github.com/StackExchange/dnscontrol/issues/1176) (#1176)
Expand Down
69 changes: 69 additions & 0 deletions documentation/providers/bunny_dns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Configuration

To use this provider, add an entry to `creds.json` with `TYPE` set to `BUNNY_DNS` along with
your [Bunny API Key](https://dash.bunny.net/account/settings).

Example:

{% code title="creds.json" %}
```json
{
"bunny_dns": {
"TYPE": "BUNNY_DNS",
"api_key": "your-bunny-api-key"
}
}
```
{% endcode %}

You can also use environment variables:

```shell
export BUNNY_API_KEY=XXXXXXXXX
```

{% code title="creds.json" %}
```json
{
"bunny_dns": {
"TYPE": "BUNNY_DNS",
"api_key": "$BUNNY_API_KEY"
}
}
```
{% endcode %}

## Metadata

This provider does not recognize any special metadata fields unique to Bunny DNS.

## Usage

An example configuration:

{% code title="dnsconfig.js" %}
```javascript
var REG_NONE = NewRegistrar("none");
var DSP_BUNNY_DNS = NewDnsProvider("bunny_dns");

D("example.com", REG_NONE, DnsProvider(DSP_BUNNY_DNS),
A("test", "1.2.3.4")
);
```
{% endcode %}

# Activation

DNSControl depends on the [Bunny API](https://docs.bunny.net/reference/bunnynet-api-overview) to manage your DNS
records. You will need to generate an [API key](https://dash.bunny.net/account/settings) to use this provider.

## New domains

If a domain does not exist in your Bunny account, DNSControl will automatically add it with the `push` command.

## Caveats

- Bunny DNS does not support dual-hosting or configuring custom TTLs for NS records on the zone apex.
- While custom nameservers are properly recognized by this provider, it is currently not possible to configure them.
- Any custom record types like Script, Redirect, Flatten or Pull Zone are currently not supported by this provider. Such
records will be completely ignored by DNSControl and left as-is.
5 changes: 5 additions & 0 deletions integrationTest/providers.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@
"TYPE": "BIND",
"domain": "$BIND_DOMAIN"
},
"BUNNY_DNS": {
"TYPE": "BUNNY_DNS",
"domain": "$BUNNY_DNS_DOMAIN",
"api_key": "$BUNNY_DNS_API_KEY"
},
"CLOUDFLAREAPI": {
"TYPE": "CLOUDFLAREAPI",
"accountid": "$CLOUDFLAREAPI_ACCOUNTID",
Expand Down
1 change: 1 addition & 0 deletions providers/_all/all.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
_ "github.com/StackExchange/dnscontrol/v4/providers/azuredns"
_ "github.com/StackExchange/dnscontrol/v4/providers/azureprivatedns"
_ "github.com/StackExchange/dnscontrol/v4/providers/bind"
_ "github.com/StackExchange/dnscontrol/v4/providers/bunnydns"
_ "github.com/StackExchange/dnscontrol/v4/providers/cloudflare"
_ "github.com/StackExchange/dnscontrol/v4/providers/cloudns"
_ "github.com/StackExchange/dnscontrol/v4/providers/cscglobal"
Expand Down
Loading

0 comments on commit 961eaa7

Please sign in to comment.