1

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?

Moshe Katz
  • 3,053
  • 3
  • 26
  • 41
yakatz
  • 1,213
  • 3
  • 12
  • 33
  • What is the problem you are having? – Michael Hampton Sep 09 '15 at 21:31
  • 1
    The filter isn't being called. "It appears that PowerDNS is not even trying to run my script. The zone transfer succeeds and the transferred zone is unchanged.... Is it possible to use a LUA filter with the BIND backend?" – yakatz Sep 09 '15 at 21:56
  • If you only launch bind, you do not need (maybe even should not want) to set `bind-hybrid` – Habbie May 09 '16 at 07:26
  • And yes, using a Lua filter should work, I can't say from your short question why it's not working. – Habbie May 09 '16 at 07:38
  • @Habbie How do I specify the name of the lua file to run? The documentation appears to say it must be in the domainmetadata and the bind backend doesn't appear to have that option. – yakatz May 16 '16 at 17:26
  • Your domainmetadata usage looks fine. Can PowerDNS read the Lua file? Also, can you post the lua script? – Habbie May 17 '16 at 07:32

0 Answers0