PowerDNS allows you to filter records on AXFR with a LUA script.
I am trying to have it change the NS records.
It appears that PowerDNS is not even trying to run my script. The zone transfer succeeds, but the transferred zone is unchanged.
I installed the pdns package on RHEL7 from EPEL (version is 3.4.5). I set it to hybrid mode because the sqlite database is where the metadata table should be.
/etc/pdns/pdns.conf
launch=bind
bind-config=/etc/pdns/bind/named.conf
bind-hybrid=yes
bind-dnssec-db=/etc/pdns/bind/metadata.db
slave=yes
/etc/pdns/bind/named.conf
options {
directory "/etc/pdns/bind";
};
zone "example.com" IN {
type slave;
masters { 192.0.2.20; };
file "example.com.zone";
};
The sqlite database was created with pdnssec create-bind-db /etc/pdns/bind/metadata.db
.
It currently contains
sqlite> .schema
CREATE TABLE domainmetadata ( id INTEGER PRIMARY KEY, domain VARCHAR(255) COLLATE NOCASE, kind VARCHAR(32) COLLATE NOCASE, content TEXT);
CREATE INDEX domainmetanameindex on domainmetadata(domain);
CREATE TABLE cryptokeys ( id INTEGER PRIMARY KEY, domain VARCHAR(255) COLLATE NOCASE, flags INT NOT NULL, active BOOL, content TEXT);
CREATE INDEX domainnameindex on cryptokeys(domain);
CREATE TABLE tsigkeys ( id INTEGER PRIMARY KEY, name VARCHAR(255) COLLATE NOCASE, algorithm VARCHAR(50) COLLATE NOCASE, secret VARCHAR(255));
CREATE UNIQUE INDEX namealgoindex on tsigkeys(name, algorithm);
sqlite> SELECT * FROM domainmetadata;
1|example.com|LUA-AXFR-SCRIPT|/etc/pdns/lua/change-ns.lua
Is it possible to use a LUA filter with the BIND backend?