CFDNS
Dynamic server DNS backed by cloudflare
Why?
If you run a server without a static IP address (e.g. at home), it can be cumbersome or expensive to keep a domain name updated with the latest IP that has been assigned to you.
Compatible with a free Cloudflare account, this script can keep you updated and online
How?
This will be written from the perspective of someone running a server in their house with a residential intenret connection backed by a provider such as Virgin media.
- In your DHCP settings, assign a static IP address to the machine that should serve requests
- With UPnP, port forward the relevant ports for access. This may be
80
and22
for standard HTTP and SSH access -
git clone
this script to a target directory -
npm install
the dependencies -
cp config.example.json config.json
and fill in the relevant details.- The
zone_id
can be found by going to the cloudflare dashboard and looking at the overview for a given domain. On the right hand side are a series of settings - see1
- Create an API token for the application. The link to do so (
2
) is located just underneath the Zone ID. The token only needsedit
permissions on theZone DNS
- The
- Set up a cron (or other scheduling option) to invoke the script at regular intervals