cloudflare-dns-updater

Instructions:

  1. Create a Cloudflare API token with the permissions that are described here by Lexicon, using the Cloudflare instruction here

  2. Clone cloudflare-dns-updater

  3. Create a .env file in the in the root directory of the cloned repo and insert a single line with LEXICON_CLOUDFLARE_AUTH_TOKEN=<Token from Cloudflare>

  4. Install all the dependencies

    python3 -m pipenv install
  5. Test maunally by running the following command:

    python3 -m pipenv run python cloudflare-dns-updater.py --domain example.com --subdomain test
  6. 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"
  7. Run crontab -e and add the following, which will update our DNS every 10 minutes:

    */10 * * * * <output from previous step>
  8. If you would like to se the output of the cron jobs you can install postfix and take a look at /var/mail/${USER}.

  9. After some time (about 30 minutes) has passed confirm that the DNS entry has been updated by running dig test.example.com