-
Create a Cloudflare API token with the permissions that are described here by Lexicon, using the Cloudflare instruction here
-
Clone cloudflare-dns-updater
-
Create a
.env
file in the in the root directory of the cloned repo and insert a single line withLEXICON_CLOUDFLARE_AUTH_TOKEN=<Token from Cloudflare>
-
Install all the dependencies
python3 -m pipenv install
-
Test maunally by running the following command:
python3 -m pipenv run python cloudflare-dns-updater.py --domain example.com --subdomain test
-
Run the following command, update the domain and subdomain
echo "cd ${PWD} && python3 -m pipenv run python cloudflare-dns-updater.py --domain example.com --subdomain test"
-
Run crontab -e and add the following, which will update our DNS every 10 minutes:
*/10 * * * * <output from previous step>
-
If you would like to se the output of the cron jobs you can install postfix and take a look at
/var/mail/${USER}
. -
After some time (about 30 minutes) has passed confirm that the DNS entry has been updated by running
dig test.example.com