You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.6 KiB
Markdown

4 years ago
# DDclient
4 years ago
4 years ago
###### guide-by-example
4 years ago
4 years ago
# Purpose & Overview
4 years ago
6 days ago
* Note - learned about [ddns-updater](https://github.com/qdm12/ddns-updater)
4 years ago
Automatic DNS entries update.
4 years ago
4 years ago
* [Official site](https://sourceforge.net/p/ddclient/wiki/usage/)
4 years ago
* [Github](https://github.com/ddclient/ddclient)
4 years ago
* [DockerHub](https://hub.docker.com/r/linuxserver/ddclient)
4 years ago
4 years ago
DDclient is a Perl client used to update dynamic DNS records.</br>
4 years ago
Very useful if not having a static IP from the ISP.
It makes sure that if you reset your router, or have a power outage,
and you get a new public IP assigned, this IP gets automaticly set
in the DNS records for your domains.
4 years ago
4 years ago
This setup runs directly on the host machine.</br>
It works by checking every 10 minutes
4 years ago
[checkip.dyndns.org](http://checkip.dyndns.org/),
4 years ago
and if the IP changed from the previous one, it logs in to the DNS provider and
updates the DNS records.
4 years ago
4 years ago
# Files and directory structure
4 years ago
4 years ago
```
4 years ago
/etc/
└── ddclient/
└── ddclient.conf
4 years ago
```
4 years ago
4 years ago
# Installation
4 years ago
4 years ago
Install ddclient from your linux official repos.
4 years ago
4 years ago
# Configuration
4 years ago
4 years ago
Official ddclient config example
4 years ago
[here](https://github.com/ddclient/ddclient/blob/master/sample-etc_ddclient.conf).
4 years ago
This setup assumes the DNS records are managed on Cloudflare.</br>
4 years ago
Make sure all subdomains in the config have A-records.
4 years ago
4 years ago
`ddclient.conf`
```bash
daemon=600
syslog=yes
mail=root
mail-failure=root
4 years ago
pid=/var/run/ddclient.pid
4 years ago
ssl=yes
use=web, web=checkip.dyndns.org/, web-skip='IP Address'
##
## CloudFlare (www.cloudflare.com)
##
protocol=cloudflare, \
4 years ago
zone=example.com, \
4 years ago
ttl=1, \
4 years ago
login=bastard@gmail.com, \
4 years ago
password=<global-api-key-goes-here> \
4 years ago
example.com,*.example.com,subdomain.example.com
4 years ago
4 years ago
##
4 years ago
protocol=cloudflare, \
4 years ago
zone=example.org, \
4 years ago
ttl=1, \
4 years ago
login=bastard@gmail.com, \
4 years ago
password=<global-api-key-goes-here> \
4 years ago
example.org,*.example.org,whatever.example.org
4 years ago
```
4 years ago
4 years ago
# Start the service
`sudo systemctl enable --now ddclient`
4 years ago
# Troubleshooting
4 years ago
If it would timeout on start, check the real location of `ddclient.pid`</br>
4 years ago
`sudo find / -name ddclient.pid`
If it is correctly set in the `ddclient.conf`.
4 years ago
# Update
4 years ago
4 years ago
During host linux packages update.
# Backup and restore
#### Backup
Using [borg](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/borg_backup)
4 years ago
that makes daily snapshot of the /etc directory which contains the config file.
4 years ago
#### restore
4 years ago
4 years ago
Replace the content of the config file with the one from the backup.