Script in PHP to update DNS type A records on porkbun.com using their API
Go to file
Ramon Caballero 0869810c83 Enhance README.md 2024-07-31 10:52:47 +01:00
PorkbunAPI.php Script in PHP to update DNS type A records on porkbun.com using their API 2024-07-31 10:49:26 +01:00
README.md Enhance README.md 2024-07-31 10:52:47 +01:00
pb-dydns.php Script in PHP to update DNS type A records on porkbun.com using their API 2024-07-31 10:49:26 +01:00

README.md

pb-dydns

Script in PHP to update DNS type A records on porkbun.com using their API.

This can easily be modified to a different programming or scripting language and domain registrar.

Prerequisites

  • At least one domain in porkbun.com with DNS type A records already pointing to your dynamic IP address.
  • Access to Porkbun API.

How to use it

from command line

$ php /path/to/pb-dydns.php domain_name

as a cron job

$ crontab -e

Modify this line to fit your needs, and add it as many times as domains you want to automatically update:

*/10 * * * *    php /path/to/pb-dydns.php domain_name > /dev/null

That will run the script every 10 minutes.

Then restart cron (I'm not sure if this is necessary):

$ sudo systemctl restart cron

Entries to pb-dydns.log will be added, to view it you can:

$ cat /path/to/pb-dydns.log