Modify PowerDNS to allow zone / record statuses

This method adds a field to the domains and records table. By manually adjusting the PowerDNS queries, only domains and records with status 1 are used by PowerDNS. Domains / records with any other status will be ignored.

Run this query on each PowerDNS mySQL server to add the status field;

ALTER TABLE `pdns`.`domains` ADD COLUMN `status` TINYINT NULL DEFAULT 1 AFTER `account`;
ALTER TABLE `pdns`.`records` ADD COLUMN `status` TINYINT NULL DEFAULT 1 AFTER `prio` ;

Add this config to the PowerDNS config /etc/pdns.conf

#MySQL Custom Queries
gmysql-master-zone-query=select master from domains where name='%s' and type='SLAVE' and status=1
gmysql-info-all-master-query=select id,name,master,last_check,notified_serial,type from domains where type='MASTER' and status=1
gmysql-info-zone-query=select id,name,master,last_check,notified_serial,type from domains where name='%s' and status=1
gmysql-basic-query=select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s' and status=1
gmysql-id-query=select content,ttl,prio,type,domain_id,name from records where type='%s' and name='%s' and domain_id=%d and status=1
gmysql-any-query=select content,ttl,prio,type,domain_id,name from records where name='%s' and status=1
gmysql-any-id-query=select content,ttl,prio,type,domain_id,name from records where name='%s' and domain_id=%d and status=1
gmysql-list-query=select content,ttl,prio,type,domain_id,name from records where domain_id=%d and status=1