Skip to main content

Power DNS

·2 mins
  • Follow these steps, if on Oracle.
  • Follow: https://repo.powerdns.com/ to add official distribution repo.
  • If port 53 is in use, free that up before proceeding. Similar to this, run:
    • sudo sed -r -i.orig 's/#?DNSStubListener=yes/DNSStubListener=no/g' /etc/systemd/resolved.conf
    • sudo systemctl restart systemd-resolved
  • sudo apt-get install -y pdns-server pdns-backend-sqlite3 sqlite3
  • Allow ingress traffic for DNS - port 53 for both TCP/UDP - on the cloud provider.
  • Now, follow steps here to setup a Sqlite backend. (Config file is present here: /etc/powerdns.)
  • Follow this if you want to setup an ALIAS record.
    • The value of resolver should be one that is able to make recursive DNS queries to upstream. Check /etc/resolv.conf: on Oracle, I had to put: resolver=169.254.169.254.
  • On the domain registrar, put DNS glue records as: ns1.tw.in.eu.org -> 155.248.213.202

Helpful commands:

sudo -u pdns pdnsutil create-zone tw.in.eu.org ns1.tw.in.eu.org
sudo -u pdns pdnsutil add-record tw.in.eu.org '' ALIAS 'hyphendiscard.duckdns.org'
sudo -u pdns pdnsutil list-zone tw.in.eu.org

# In the following, I can substitute 127.0.0.1 with the public IP of the instance if I want to test externally.
dig +short tw.in.eu.org @127.0.0.1
dig +short tw.in.eu.org NS @127.0.0.1
dig +short tw.in.eu.org ALIAS @127.0.0.1

# Note: I wasn't able to make DNSSEC work on Oracle.
sudo -u pdns pdnsutil secure-zone tw.in.eu.org
sudo -u pdns pdnsutil rectify-zone tw.in.eu.org

sudo -u pdns pdnsutil show-zone tw.in.eu.org
sudo -u pdns pdnsutil disable-dnssec tw.in.eu.org
sudo -u pdns pdnsutil edit-zone tw.in.eu.org

sudo -u pdns pdnsutil check-all-zones