Skip to content

FOSDEM 2022 powerdns round robin

Vasil Kolev edited this page Jan 21, 2024 · 5 revisions

powerdns authorative server lua script round robin

https://doc.powerdns.com/authoritative/lua-records/

fs.vocconf.org 3600    IN      SOA     fs.vocconf.org hostmaster.fs.vocconf.org 4 10800 3600 604800 3600
fs.vocconf.org 3600    IN      NS      ns1.fs.vocconf.org
fs.vocconf.org 3600    IN      NS      ns2.fs.vocconf.org
s.fs.vocconf.org       60      IN      LUA     A "ifportup(443, {'142.132.177.20','142.132.177.48','88.99.80.133','88.198.156.213'})"
s.fs.vocconf.org       60      IN      LUA     A "ifportup(443, {'23.88.125.128', '142.132.177.43','23.88.118.126','142.132.177.16'})"
s.fs.vocconf.org       60      IN      LUA     A "ifportup(443, {'49.12.104.68','142.132.177.30','142.132.177.31','23.88.122.123'})"
s.fs.vocconf.org       60      IN      LUA     A "ifportup(443, {'78.47.67.129','142.132.177.47','142.132.177.18','142.132.177.46'})"
s.fs.vocconf.org       60      IN      LUA     AAAA "ifportup(443, {'2a01:4f8:c17:98bd::1','2a01:4f8:c17:9a27::1','2a01:4f8:c17:e32c::1','2a01:4f8:c17:ef46::1'})"
s.fs.vocconf.org       60      IN      LUA     AAAA "ifportup(443, {'2a01:4f8:c17:f4dd::1','2a01:4f8:1c17:5310::1','2a01:4f8:1c17:c64c::1','2a01:4f8:1c17:cb54::1'})"
s.fs.vocconf.org       60      IN      LUA     AAAA "ifportup(443, {'2a01:4f8:1c17:e5d4::1','2a01:4f8:1c17:e5e7::1','2a01:4f8:1c17:e619::1','2a01:4f8:1c17:e6fa::1'})"
s.fs.vocconf.org       60      IN      LUA     AAAA "ifportup(443, {'2a01:4f8:1c17:f5bb::1','2a01:4f8:1c17:fdb9::1','2a01:4f8:1c17:ffd7::1','2a01:4f8:c010:1f2::1'})"

apt install pdns-server pdns-backend-sqlite3 sqlite3

https://doc.powerdns.com/authoritative/guides/basic-database.html

vi /etc/powerdns/pdns.conf

launch=gsqlite3
gsqlite3-database=/var/lib/powerdns/pdns.sqlite3
enable-lua-records
sqlite3 /var/lib/powerdns/pdns.sqlite3 < /usr/share/doc/pdns-backend-sqlite3/schema.sqlite3.sql
chown -R pdns:pdns /var/lib/powerdns
systemctl restart pdns
pdnsutil create-zone fs.vocconf.org ns1.fs.vocconf.org
pdnsutil edit-zone fs.vocconf.org
Clone this wiki locally