Case Study - Global Reach, Local Touch: The Role of GeoDNS in eCommerce Expansion

PowerDNS PgSQL Slave zones delete

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.

Configuration

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.

Usage

When you are ready with your configuration, you can run the script with the following command:

php powerdns-pgsql-slave-zones-delete.php

Output

The script will show you a list with all the successfully/unsuccessfully deleted zones.

Possible problems

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);

Cron job

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


Last modified: 2019-02-21
Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more