Dynamic DNS for CloudFlare with cfdns
cfdns is simple and clean solution to update your CloudFlare dynamic A records.
Installation
Download and install
Create the cfdns directory under ´/opt´
1
mkdir /opt/cfdns && cd /opt/cfdns
Get the latest version here: https://github.com/someone-stole-my-name/cfdns/releases
1
2
3
wget https://github.com/someone-stole-my-name/cfdns/releases/download/v1.0/cfdns_linx64
mv cfdns_linx64 cfdns
chmod +x cfdns
Configuration
cfdns uses a simple and self explanatory JSON file that looks like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"IPEndpoint": "https://ipinfo.io/ip",
"Sleep": 60,
"Records":
[
{
"Username": "myaccount@someone.com",
"API-Key": "88b2b8e3d2b68b9cc4b945d81516v91d77k6g",
"Zone": "myzone.xyz",
"Entry": "myzone.xyz"
},
{
"Username": "myaccount_1@someone.com",
"API-Key": "55b2b8e3d2b68b9cc4b945d81516v91d77k6g",
"Zone": "anotherzone.xyz",
"Entry": "anotherzone.xyz"
}
]
}
Add as many Records
as you need and write it to /opt/cfdns/config.json
.
Systemd
Download the systemd Unit file and move it to /etc/systemd/system/
1
2
wget https://raw.githubusercontent.com/someone-stole-my-name/cfdns/master/cfdns.service
mv cfdns.service /etc/systemd/system/
Enable and start the new service
1
2
3
sudo systemctl daemon-reload
sudo systemctl enable cfdns
sudo systemctl start cfdns
Note: By default the Unit is configured to read the config file from /opt/cfdns/config.json
, if you created the file somewhere else you have to modify the Unit accordingly.