Commit 36b5ec4ece

36b5ec4ece3149394998af4690d3316ba7d75ec3

parent: ef6048e9e5

Unsigned

cmc <hello@cleberg.net> · 2024-03-15 15:04 UTC

format ddns-updater post

Layout: unified · split

content/blog/2024-03-15-self-hosting-ddns-updater.md +43 −18
@@ -4,19 +4,25 @@ title = "Self-Hosting DDNS Updater"
44description = "A guide to self-hosting the DDNS Updater container."
55+++
66
7![DDNS Updater Web View](https://img.cleberg.net/blog/20240315-ddns-updater/ddns.png)
7![DDNS Updater Web
8View](https://img.cleberg.net/blog/20240315-ddns-updater/ddns.png)
89
9[DDNS Updater](https://github.com/qdm12/ddns-updater) is a program to keep DNS A and/or AAAA records updated for multiple DNS providers.
10[DDNS Updater](https://github.com/qdm12/ddns-updater) is a program to keep DNS A
11and/or AAAA records updated for multiple DNS providers.
1012
11If you've read any of my other posts, you'll notice that I have been searching for and using a few different DDNS updating solutions for years. You'll also notice that I love any projects that offer a Docker Compose solution.
13If you've read any of my other posts, you'll notice that I have been searching
14for and using a few different DDNS updating solutions for years. You'll also
15notice that I love any projects that offer a Docker Compose solution.
1216
1317Luckily, DDNS Upater fits both of these preferences.
1418
1519## Installation
1620
17To get started, always make sure to review the project's [README](https://github.com/qdm12/ddns-updater/blob/master/README.md). I'll be documenting my steps below, but they may have changed by the time you read this.
21To get started, always make sure to review the project's
22[README](https://github.com/qdm12/ddns-updater/blob/master/README.md). I'll be
23documenting my steps below, but they may have changed by the time you read this.
1824
19The first step is to set up the directories and files required for the project.
25The first step is to set up the directories and files required for the project.
2026
2127```sh
2228mkdir ~/ddns-updater
@@ -26,7 +32,9 @@ touch ~/ddns-updater/data/config.json
2632
2733### Configuration
2834
29The main configuration you need to update is the `data/config.json` file. There is a large list of supported providers in the README, but I'm going to use Cloudflare in this example.
35The main configuration you need to update is the `data/config.json` file. There
36is a large list of supported providers in the README, but I'm going to use
37Cloudflare in this example.
3038
3139```sh
3240nano ~/ddns-updater/data/config.json
@@ -35,17 +43,27 @@ nano ~/ddns-updater/data/config.json
3543When setting up the configuration for Cloudflare, you'll need the following:
3644
3745- Required Parameters
38 - `"zone_identifier"` is the Zone ID of your site from the domain overview page
39 - `"host"` is your host and can be `"@"`, a subdomain or the wildcard `"*"`. See [this issue comment for context](https://github.com/qdm12/ddns-updater/issues/243#issuecomment-928313949).
46 - `"zone_identifier"` is the Zone ID of your site from the domain overview
47 page
48 - `"host"` is your host and can be `"@"`, a subdomain or the wildcard `"*"`.
49 See [this issue comment for
50 context](https://github.com/qdm12/ddns-updater/issues/243#issuecomment-928313949).
4051 - `"ttl"` integer value for record TTL in seconds (specify 1 for automatic)
41 - One of the following ([how to find API keys](https://developers.cloudflare.com/fundamentals/api/get-started/)):
52 - One of the following ([how to find API
53 keys](https://developers.cloudflare.com/fundamentals/api/get-started/)):
4254 - Email `"email"` and Global API Key `"key"`
4355 - User service key `"user_service_key"`
44 - API Token `"token"`, configured with DNS edit permissions for your DNS name's zone
56 - API Token `"token"`, configured with DNS edit permissions for your DNS
57 name's zone
4558- Optional Parameters
4659 - `"proxied"` can be set to `true` to use the proxy services of Cloudflare
47 - `"ip_version"` can be `ipv4` (A records), or `ipv6` (AAAA records) or `ipv4 or ipv6` (update one of the two, depending on the public ip found). It defaults to `ipv4 or ipv6`.
48 - `"ipv6_suffix"` is the IPv6 interface identifier suffix to use. It can be for example `0:0:0:0:72ad:8fbb:a54e:bedd/64`. If left empty, it defaults to no suffix and the raw public IPv6 address obtained is used in the record updating.
60 - `"ip_version"` can be `ipv4` (A records), or `ipv6` (AAAA records) or `ipv4
61 or ipv6` (update one of the two, depending on the public ip found). It
62 defaults to `ipv4 or ipv6`.
63 - `"ipv6_suffix"` is the IPv6 interface identifier suffix to use. It can be
64 for example `0:0:0:0:72ad:8fbb:a54e:bedd/64`. If left empty, it defaults to
65 no suffix and the raw public IPv6 address obtained is used in the record
66 updating.
4967
5068```conf
5169{
@@ -65,7 +83,8 @@ When setting up the configuration for Cloudflare, you'll need the following:
6583}
6684```
6785
68Once you have configured the provider of your choice, correct the file and directory permissions and ownership.
86Once you have configured the provider of your choice, correct the file and
87directory permissions and ownership.
6988
7089```sh
7190cd ~/ddns_updater
@@ -79,7 +98,8 @@ chmod 400 data/config.json
7998
8099### Docker Compose
81100
82After creating the project structure, let's create the `docker-compose.yml` file.
101After creating the project structure, let's create the `docker-compose.yml`
102file.
83103
84104```sh
85105nano ~/ddns_-pdater/docker-compose.yml
@@ -123,18 +143,22 @@ services:
123143 restart: always
124144```
125145
126After configuring your preferences in the `docker-compose.yml`, launch the container.
146After configuring your preferences in the `docker-compose.yml`, launch the
147container.
127148
128149```sh
129150cd ~/ddns-updater
130151sudo docker-compose up -d
131152```
132153
133If you've launched this on your local machine, you can launch `localhost:8097` in your browser to see the results.
154If you've launched this on your local machine, you can launch `localhost:8097`
155in your browser to see the results.
134156
135157### Nginx Reverse Proxy
136158
137If you launched this service on a server, other machine, or just want to access it remotely via a domain name, you can use Nginx as a reverse proxy to expose the service publicly.
159If you launched this service on a server, other machine, or just want to access
160it remotely via a domain name, you can use Nginx as a reverse proxy to expose
161the service publicly.
138162
139163Start by creating the Nginx configuration file.
140164
@@ -162,7 +186,8 @@ server {
162186}
163187```
164188
165Here's a full example that uses my Authelia authentication service to require authentication before someone can access the web page.
189Here's a full example that uses my Authelia authentication service to require
190authentication before someone can access the web page.
166191
167192```conf
168193server {