-
-
Save JedMeister/b5dd72af0e2be68d978198ca3bf4f2fd to your computer and use it in GitHub Desktop.
Cloudflare + Dynamic DNS (ddclient) = Super Awesome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This guide will show you how to configure ddclient to dynamically update your DNS at Cloudflare. | |
# This cookbook makes use of a number of online guides - all referenced at the end. | |
# Note all commands require root, so if you aren't already logged in as root, either run: | |
sudo su - | |
# to switch to the root user or prefix every command with: | |
sudo <COMMAND...> | |
# Cloudflare requires ddclient to be version 3.8.2 or you will get a 'cloudflare protocol didn't exist'. | |
# Debian 10/Bullseye has [3.9.1](https://packages.debian.org/bullseye/ddclient) so should be good to go. | |
# Installation - be sure to use from a "proper" interactive terminal (e.g. SSH in) | |
apt-get update | |
apt-get install -y ddclient | |
# During install, you will be asked some questions. Answer them like this: | |
- Dynamic DNS service provider: | |
other | |
- Dynamic DNS update protocol: | |
cloudflare | |
- Username: | |
<YOUR CLOUDFLARE EMAIL ADDRESS> | |
- Password: | |
<YOUR CLOUDFLARE API KEY> | |
(see https://www.cloudflare.com/a/account/<MY_ACCOUNT>) | |
- Re-enter password: | |
<YOUR CLOUDFLARE API KEY> | |
- IP address discovery method: | |
Web-based IP discovery service | |
- Hosts to update (comma-separated): | |
<DOMAIN AND/OR SUB-DOMAIN NAME/S TO UPDATE> | |
# Good news, you are technically good to go! Test your setup by: | |
ddclient -daemon=0 -debug -verbose -noquiet | |
# Check the log and see if there are any messages. Most likely issues will be with config file (/etc/ddclient.conf), | |
# so either update manually or re-run through questions like this: | |
dpkg-reconfigure ddclient | |
# Retest with the above line until it works without any error | |
# By default, it will run every 5 minutes, whoich should be fine. If you wish to change that, i can be configured | |
# in /etc/default/ddclient | |
# You cna view the status of the ddclient update service with this command: | |
systemclt status ddclient | |
# Resources: | |
# Original gist: | |
# https://gist.github.com/benscabbia/a6b158974219f96ecb1e87b97890c5fe | |
# Other resources (from original gist): | |
# https://www.cloudflare.com/technical-resources/#ddclient | |
# https://jenssegers.com/84/dynamic-dns-for-cloudflare-with-ddclient | |
# https://samhobbs.co.uk/2015/01/dynamic-dns-ddclient-raspberry-pi-and-ubuntu |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment