With this script, you can delete slave zones in ClouDNS, when they are deleted from the PowerDNS database. You can download the script from here.
AUTH_ID should be your API user ID AUTH_PASS should be the password of your API user:
define("AUTH_ID", 0);
define("AUTH_PASS", "xxx");
In the PowerDNS pgsql configuration section:
- "PDNS_PGSQL_HOST" is the host (IP address) to connect to. Note, that it is best to point the IP address of the database here.
- "PDNS_PGSQL_USER" is the username to connect as.
- "PDNS_PGSQL_PASS" is the password for the username.
- "PDNS_PGSQL_DB" is the name of the database to connect to. Default is "pdns".
- "PDNS_PGSQL_PORT" is the port to connect through. Default is 3306.
When you are ready with your configuration, you can run the script with the following command:
php powerdns-pgsql-slave-zones-delete.php
The script will show you a list with all the successfully/unsuccessfully deleted zones.
Errors will occur, if you:
- enter wrong AUTH_ID and/or AUTH_PASS for the API user;
- enter incorrect data for your PowerDNS configuration (host IP, username, password, database, port);
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-delete.php >/dev/null