A self-hosted Dynamic DNS solution similar to DynDNS or NO-IP
Go to file
Philipp Böhm e2b997707b add links for status badges 2021-02-20 19:58:49 +01:00
.circleci fix docker push with latest tag 2021-02-20 16:46:08 +01:00
backend fix import path for gin-gonic, introduce go module and change base docker image 2019-08-26 12:00:32 +02:00
docker Add DDNS_EXPIRATION_DAYS env variable 2020-10-02 12:10:35 +02:00
frontend Update hostname regex to accept "-" 2021-02-18 22:54:27 +08:00
shared change dns api listen port to 8053 which is more like the real dns port 2018-01-27 21:03:46 +01:00
.gitignore add ACME_AGREE env variable to override sample and remove requirement for changing local path 2019-08-29 08:46:04 +02:00
LICENSE bump year in LICENSE and remove copyright from frontend template 2020-01-13 10:59:22 +01:00
README.md add links for status badges 2021-02-20 19:58:49 +01:00
ddns.go move config parsing into the shared package 2017-12-03 23:18:47 +01:00
go.mod fix import path for gin-gonic, introduce go module and change base docker image 2019-08-26 12:00:32 +02:00
go.sum fix import path for gin-gonic, introduce go module and change base docker image 2019-08-26 12:00:32 +02:00

README.md

ddns - Dynamic DNS

CircleCI Docker Image Size (tag) Docker Pulls GitHub

A self-hosted Dynamic DNS solution similar to DynDNS or NO-IP.

You can use a hosted version at ddns.pboehm.de where you can register a host under the d.pboehm.de domain (e.g test.d.pboehm.de).

Recent Changes

ddns has been fully restructured and now uses the PowerDNS Remote Backend instead of the Pipe Backend, which is far easier to deploy. It now serves both the frontend and the backend over HTTP using different ports.

The old ddns source code can be found at the legacy tag.

How can I update my IP if it changes?

ddns is built around a small webservice, so that you can update your IP address simply by calling an URL periodically through curl. Hosts that haven't been updated for 10 days will be automatically removed. This can be configured in your own instance.

An API similar to DynDNS/NO-IP has not been implemented yet.

Self-Hosting

Requirements

  • A custom domain where the registrar allows setting NS records for subdomains. This is important because not all DNS providers support this.
  • A server with docker and docker-compose installed
  • The following ports should be opened in the firewall:
    • 53/udp
    • 80/tcp
    • 443/tcp

DNS-Setup

For the domain you want to use with ddns (example.net in the following sections, please adjust this to your domain) you have to create the following two DNS records:

  • ddns.example.net as a CNAME or A/AAAA record pointing to the server ddns will be running on. This record will be used for accessing the ddns frontend in your browser or via curl. It is also the target for the corresponding NS record.
  • d.example.net as an NS record pointing to the previously created ddns.example.net record. This will delegate all subdomains under d.example.net to the PowerDNS server running on ddns.example.net.

ddns-Setup

The setup is now automated using docker-compose and only some customization has to be made in a docker-compose.override.yml file (a sample is available here).

Configuring the Setup

The setup included in this repository contains all the components described above and uses caddy as a web server, because it provides automatic HTTPS using Lets Encrypt.

git clone git@github.com:pboehm/ddns.git
cd ddns/docker
cp docker-compose.override.yml.sample docker-compose.override.yml

Please adjust the settings in docker-compose.override.yml marked with the #<<< .... comments as follows:

  • adjust the domain part in lines marked with # <<< ADJUST DOMAIN according to your DNS-Setup
  • insert your email address in lines marked with # <<< INSERT EMAIL which is required for getting certificates from Lets Encrypt

Finally execute the following docker-compose command, which creates 4 containers in detached mode which are also started automatically after reboot. For updating an existing installation use the same command because it automatically rebuilds the containers.

docker-compose --project-name ddns up -d --build