With this script, you can add Slave DNS zones at ClouDNS with PowerDNS Master server and MySQL 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 server.
MASTER_IP2 is the second IP address of your PowerDNS server (optional).
PDNS_MYSQL_HOST is the IP address of your MySQL server.
PDNS_MYSQL_USER is your MySQL database username.
PDNS_MYSQL_PASS is your MySQL database password.
PDNS_MYSQL_DB is your database name in MySQL.
PDNS_MYSQL_PORT is the listening port of your MySQL 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 MySQL 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 created at ClouDNS.
If your API user ID or Password are incorrect, you will get an error message.
If the MySQL 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-mysql-slave-zones-add.php