A simple DDNS client for porkbun.com.
I just want the A records for *.my-domain.xyz and my-domain.xyz to justwerk™.
Install the script.
git clone https://github.com/brege/porkbun-ddns.git
cd porkbun-ddns
sudo install -m 755 porkbun /usr/local/bin/porkbun-ddnsCreate a config file.
sudo mkdir -p /etc/porkbun-ddns
sudo mkdir -p /var/lib/porkbun-ddns# /etc/porkbun-ddns/config.ini
dns_porkbun_key=pk1_****
dns_porkbun_secret=sk1_****
domain=example.com
data_dir=/var/lib/porkbun-ddnsInstall as a systemd timer that runs at a 5 minute interval and updates the A records on porkbun.com.
sudo cp systemd/porkbun-ddns.* /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now porkbun-ddns.timerIf you use certbot from Let's Encrypt, you can use the same config for your renewals.
sudo certbot certonly --authenticator dns-porkbun \
--dns-porkbun-credentials /etc/porkbun-ddns/config.ini \
--dns-porkbun-propagation-seconds 30 \
-d example.com -d "*.example.com"To change an existing renewal entry manually, edit
/etc/letsencrypt/renewal/example.com.conf
and change the dns_porkbun_credentials = entry.
- The script explicitly filters Porkbun’s response down to
"type":"A"entries. Everything else (MX, TXT, CNAME, SRV, etc.) is ignored. - This scripts' only objective is to ensure your domain and its subdomains are always reachable from the internet.