An application which updates the DNS records in your DNS providers when your external/internet-facing IP address changes.
Update checks can occur on a frequency specified in configuration.
- DigitalOcean
- GoDaddy
- Address (A)
More record types will be added at a later date.
-
Pull the DDNSUpdate package from the DDNSUpdate Repository at GitHub.
docker pull ghcr.io/thedanieldoyle/ddnsupdate:latest
-
Set up configuration using either config file, environment variables or Docker secrets.
-
Run the application using either Docker CLI or Docker Compose.
-
The following is an example using config.json file configuration and docker run.
docker run -d --name ddnsupdate -v /apps/ddnsupdate/config.json:/app/config.json ghcr.io/thedanieldoyle/ddnsupdate:latest
-
The following is an example using docker-compose.
docker-compose up -d
-
See the Docker sample folder for an example of a docker-compose.yml file.
DDNSUpdate supports three configuration types (all three may be used at the same time):
- Configuration file
- Environment variables
- Docker secrets
The easiest to set up and use is the configuration file. It is possible however to keep all non-sensitve configuration in a configuration file and use Docker secrets or environment variables to configure senstive values.
- The config.json or config.yml/yaml must be bound using a bind mount if you are using file configuration.
- See the Configuration sample folder for examples of config.json and config.yml/yaml file configuration.
- The config.json or config.yml/yaml must be bound in the container to either:
- /app/config.json
- /app/config.yml
- /app/config.yaml
-
The following example configures two External Address providers.
ExternalAddressProviders__0__Uri=https://bot.whatismyipaddress.com/
ExternalAddressProviders__1__Uri=https://ipv4bot.whatismyipaddress.com/
-
See ASP.NET Core Environment configuration for instructions on how to structure the Environment Variable names.
-
As with the environment variables, name your Docker Secrets the same way.
printf "https://bot.whatismyipaddress.com/" | docker secret create ExternalAddressProviders__0__Uri -
printf "https://ipv4bot.whatismyipaddress.com/" | docker secret create ExternalAddressProviders__1__Uri -
-
See ASP.NET Core Key-per-file configuration for instructions on how to structure the Docker Secret names.
DDNSUpdate supports multi-platform builds with buildx, post dotnet SDK verison 7.0.300.
Replace REGISTRY with your own if you are pushing to a Docker registry.
export DOCKERFILE=DDNSUpdate/Dockerfile;
export REGISTRY=ghcr.io/thedanieldoyle;
export SERVICE=ddnsupdate;
export VERSION=1.0.0;
docker buildx build --platform linux/amd64,linux/arm64 --tag "${REGISTRY}/$SERVICE:$VERSION" --build-arg VERSION --file $DOCKERFILE --push .
To support multi-platform builds, changes were required to the dotnet SDK from Microsoft, and also use of some automatic ARGs from Docker. Namely BUILDPLATFORM and TARGETARCH. See Docker documentation.
Also, the build command above will attempt to push to your docker registry using --push, therefore be sure to log in first.
If you just want to build an image for local development, change --push to --load.
You may notice on the docker buildx build command, the --build-arg VERSION is not using the variable with $ symbol, as set above. This is by design. The Docker documentation explains.
You may also use the --build-arg flag without a value, in which case the value from the local environment will be propagated into the Docker container
As the variable in the shell scope and inside the Dockerfile are the same name, you don't need to specify it in VERSION=$VERSION syntax when building. Neat!
- Daniel P. Doyle - TheDanielDoyle
- Adam Parker - ParkerAdam
- Michael Willis - Mickey-Willis
See also the list of contributors who participated in this project.
We would like to thank the following open source projects.
Project | Repository | License |
---|---|---|
Ardalis.SmartEnum | https://github.com/ardalis/SmartEnum | LICENSE |
AutoMapper | https://github.com/AutoMapper/AutoMapper | LICENSE |
FakeItEasy | https://github.com/FakeItEasy/FakeItEasy | LICENSE |
FluentResults | https://github.com/altmann/FluentResults | LICENSE |
FluentValidation | https://github.com/FluentValidation/FluentValidation | LICENSE |
Flurl | https://github.com/tmenier/Flurl | LICENSE |
NetEscapades.Configuration | https://github.com/andrewlock/NetEscapades.Configuration | LICENSE |
Newtonsoft.Json | https://github.com/JamesNK/Newtonsoft.Json | LICENSE |
Serilog | https://github.com/serilog/serilog | LICENSE |
xunit | https://github.com/xunit/xunit | LICENSE |
YamlDotNet | https://github.com/aaubry/YamlDotNet | LICENSE |
This project is licensed under the MIT License - see the LICENSE file for details.