pschiffe / docker-pdns

Docker images for PowerDNS
MIT License
274 stars 81 forks source link

Question?: are LUA records enabled or I'm doing it wrong? #88

Closed codygamer666 closed 1 year ago

codygamer666 commented 1 year ago

Hello, I'm currently evaluating a new dns setup for my msp with powerdns. To keep matters simple we will use a bunch of clustered debian vms with powerdns running under docker (for easy updates). The feature that is at the center of evaluation is the ability of load balancing using LUA scripts and powerdns port check (https://doc.powerdns.com/authoritative/lua-records/index.html). So I powered up an instance of pdns-mysql + db + powerdns admin and created a test domain (example.com), then assigned two A records (test.example.com) to two different ips (ex 192.168.0.10 192.168.0.11) and added a LUA record (A "ifportup(80, {'192.168.0.10', '192.168.0.11'})". After this I turned off the vm with ip 192.168.0.10, waited 60s and then asked the server a query for test.example.com. At first the server responded 192.168.0.11, but after 5 minutes it switched to 192.168.0.10... Is this the right method? Do I need a recursor in front of this setup? Or are LUA records disabled? Thank you in advance!

codygamer666 commented 1 year ago

Reading the official docs the process that will test the port is on the master server (no recursor required as LUA records are only advertised in zone transfers), so I will try a barebone install with a db + powerdns admin under docker to speed up testing. If the result is successful, I think there are only two plausible causes: the tool which monitors the ports is missing or the container itself cannot comunicate unless its fully exposed (as layer2 bridge). I will update soon, if you come up with something I will be glad for your help.

pschiffe commented 1 year ago

Hello, were you able to to find out the problem with LUA? I'm sorry, never used this feature. Just seeing in the doc, that you need to enable it indeed:

To enable this feature, either set ‘enable-lua-records’ in the configuration, or set the ‘ENABLE-LUA-RECORDS’ per-zone metadata item to 1.

codygamer666 commented 1 year ago

oh well, sorry for the late reply. I tried adding that line in the configuration, but still nothing. In the end I changed dns server as that feature is necessary in my setup. Thank you