2020-05-30 15:54:07 +02:00
## Configuration
2022-05-08 14:41:33 -04:00
To use this provider, add an entry to `creds.json` with `TYPE` set to `POWERDNS`
along with your [API URL, API Key and Server ID ](https://doc.powerdns.com/authoritative/http-api/index.html ).
In most cases the Server id is `localhost` .
Example:
2020-05-30 15:54:07 +02:00
2023-03-02 22:17:27 +01:00
{% code title="creds.json" %}
2022-02-17 18:22:31 +01:00
```json
2020-05-30 15:54:07 +02:00
{
"powerdns": {
2022-05-08 14:41:33 -04:00
"TYPE": "POWERDNS",
2020-11-28 21:43:13 +01:00
"apiKey": "your-key",
2022-05-08 14:41:33 -04:00
"apiUrl": "http://localhost",
2020-11-28 21:43:13 +01:00
"serverName": "localhost"
2020-05-30 15:54:07 +02:00
}
}
2022-02-17 18:22:31 +01:00
```
2023-03-02 22:17:27 +01:00
{% endcode %}
2020-05-30 15:54:07 +02:00
## Metadata
Following metadata are available:
2023-03-11 14:42:01 +01:00
{% code title="dnsconfig.js" %}
2023-01-20 13:56:20 +01:00
```javascript
2020-05-30 15:54:07 +02:00
{
'default_ns': [
'a.example.com.',
'b.example.com.'
],
2023-04-25 00:16:23 +02:00
'dnssec_on_create': false,
'zone_kind': 'Native',
2020-05-30 15:54:07 +02:00
}
2022-02-17 18:22:31 +01:00
```
2023-03-11 14:42:01 +01:00
{% endcode %}
2020-05-30 15:54:07 +02:00
- `default_ns` sets the nameserver which are used
- `dnssec_on_create` specifies if DNSSEC should be enabled when creating zones
2023-04-25 00:16:23 +02:00
- `zone_kind` is the type that will be used when creating the zone.
< br > Can be one of `Native` , `Master` or `Slave` , when not specified it defaults to `Native` .
< br > Please see [PowerDNS documentation ](https://doc.powerdns.com/authoritative/modes-of-operation.html ) for explanation of the kinds.
< br > **Note that these tokens are case-sensitive!**
2023-08-18 15:50:21 +01:00
- `soa_edit_api` is the default SOA serial method that is used for zone created with the API
< br > Can be one of `DEFAULT` , `INCREASE` , `EPOCH` , `SOA-EDIT` or `SOA-EDIT-INCREASE` , default format is YYYYMMDD01.
< br > Please see [PowerDNS SOA-EDIT-DNSUPDATE documentation ](https://doc.powerdns.com/authoritative/dnsupdate.html#soa-edit-dnsupdate-settings ) for explanation of the kinds.
< br > **Note that these tokens are case-sensitive!**
2020-05-30 15:54:07 +02:00
## Usage
2023-03-11 14:42:01 +01:00
An example configuration:
2020-05-30 15:54:07 +02:00
2023-03-11 14:42:01 +01:00
{% code title="dnsconfig.js" %}
2023-01-20 13:56:20 +01:00
```javascript
2022-05-08 14:41:33 -04:00
var REG_NONE = NewRegistrar("none");
var DSP_POWERDNS = NewDnsProvider("powerdns");
2020-05-30 15:54:07 +02:00
2023-06-17 14:58:17 +02:00
D("example.com", REG_NONE, DnsProvider(DSP_POWERDNS),
2022-05-08 14:41:33 -04:00
A("test", "1.2.3.4")
2020-05-30 15:54:07 +02:00
);
2022-02-17 18:22:31 +01:00
```
2023-03-11 14:42:01 +01:00
{% endcode %}
2020-05-30 15:54:07 +02:00
## Activation
See the [PowerDNS documentation ](https://doc.powerdns.com/authoritative/http-api/index.html ) how the API can be enabled.