With this script you can add Slave DNS zones at ClouDNS with PowerDNS Master server and pgSQL database. You can download it from here.
AUTH_ID should be your API user ID AUTH_PASS should be the password of your API user.
MASTER_IP is the IP address of your PowerDNS Master serer.
MASTER_IP2 is the second IP address of your PowerDNS server (optional).
PDNS_PGSQL_HOST is the IP address of your pgSQL server.
PDNS_PGSQL_USER is your pgSQL database username.
PDNS_PGSQL_PASS is your pgSQL database password.
PDNS_PGSQL_DB is your database name in pgSQL.
PDNS_PGSQL_PORT is the listening port of your pgSQL server port.
TMPFILE is the temp file which will contain a list of zones which are already added or checked with the HTTP API.
// Auth ID and Password
// IP address of the master server (primary server)
// Second IP address for master server (it may be IPv6 or IPv4 address)
// PowerDNS pgsql configuration
// this file will contain a list of zones, which are already added or checked with the HTTP API
When you are ready with your configuration, you can run the script with the following command:
The script will output a list with Slave DNS zones craeted at ClouDNS.
If your API user ID or Password are incorrect, you will get an error message.
If the pgSQL details and credentials are incorrect, you will get an error message.
You can add this script to be executed each first day from the month. Example:
0 0 1 * * /usr/bin/php /path/to/php powerdns-pgsql-slave-zones-add.php
Last modified: 2019-02-21