This is a small project that updates a Cloudflare DNS record with the current public IP address of the machine it is running on.
It should run frequently, probably with a service system like systemd, for which a unit file is provided.
Follow these steps
git clone https://github.com/t-mart/cf-dyn-dns.git
cd cf-dyn-dns
deno cf-dyn-dns
-
Add the service and timer files to the systemd directory:
sudo cp cf-dyn-dns.service /etc/systemd/system/ sudo cp cf-dyn-dns.timer /etc/systemd/system/
-
Review the
cf-dyn-dns.service
file and make changes as appropriate. -
Copy
.env.template
to.env
and fill in the required values. -
Enable and start the service:
sudo systemctl enable cf-dyn-dns.service sudo systemctl enable cf-dyn-dns.timer sudo systemctl start cf-dyn-dns.service sudo systemctl start cf-dyn-dns.timer
and check the status and the logs:
sudo systemctl status cf-dyn-dns journalctl -u cf-dyn-dns