Skip to content

Yet another dynamic DNS updater focused on Russian DNS providers

License

Notifications You must be signed in to change notification settings

sfadeev/dddns-updater

Repository files navigation

dddns updater

Yet another dynamic DNS updater focused on Russian DNS providers.

Inspired by qdm12/ddns-updater

Build status Last release

Features

  1. Allow using your domains without having Static IP
  2. Available as a Docker image at ghcr.io
  3. Update A record of configured domains in .json file for supported DNS providers
  4. Store IP updates history in .json file
  5. Simple web UI to view updates history
  6. Backup configuration and updates history files
  7. Optional Send notifications with Apprise
  8. Optional Healthcheck with Healthchecks.io
  9. Optional Integration with logging systems e.g. Seq

Setup

Container

  1. Create a directory for program, e.g. dddns-updater
  2. In program directory create a directory data for settings and updates history files
  3. Write a JSON configuration file in data/settings.json, for example:
{
  "Settings": {
  	"BaseUrl": "http://192.168.1.1:8080/"
  },
  "Providers": [
    {
      "Provider": "provider",
      "Domains": [
        "my-domain.ru"
      ],
      "Username": "provider-user",
      "Password": "provider-password"
    }
  ]
}
  1. In program directory write in file docker-compose.yml, for example:
services:
    dddns-updater:
        container_name: dddns-updater
        image: ghcr.io/sfadeev/dddns-updater:latest
        ports:
            - 8080:8080
        restart: unless-stopped
        volumes:
            - ./data:/app/data
  1. Run container with command:
  docker compose up -d

Configuration

Main configuration of service is stored in appsettings.json supplied in docker image. File data/settings.json loaded after appsettings.json and extends main configuration using .NET configuration rules.

Start with the following sample content in data/settings.json:

{
  "Settings": {
  	"BaseUrl": "http://192.168.1.1:8080/"
  },
  "Providers": [
    {
      "Provider": "provider-1",
      "Domains": [
        "domain-1.ru"
      ],
      "Username": "user-1",
      "Password": "password-1"
    },
    {
      "Provider": "provider-2",
      "Domains": [
        "domain-2.ru"
      ],
      "Username": "user-2",
      "Password": "password-2"
    }
  ]
}

Settings

Common options in section Settings

Option Default Description
BaseUrl Base URL for web UI
UpdatesFilePath ./data/updates.json File to store updates history
BackupDirPath ./data/ Directory for backups
BackupFileNamePrefix backup Backup filename prefix
MaxUpdatesPerDomain 10 Max records in updates history stored for each domain
MaxBackups 7 Max backup files count

Providers

For each provider in section Providers specify domain(s) and other provider specific parameters

Beget

Example configuration

{
  "Providers": [
    {
      "Provider": "beget",
      "Domains": [
        "my-domain.ru", "sub.my-domain.ru" 
      ],
      "Username": "beget-user",
      "Password": "beget-password"
    }
  ]
}
Option Required Description
Username Beget username
Password Beget password

Links

  1. Beget API documentation (en) - https://beget.com/en/kb/api/dns-administration-functions
  2. Beget API documentation (ru) - https://beget.com/ru/kb/api/funkczii-upravleniya-dns (ru)

Timeweb

Example configuration

{
  "Providers": [
    {
      "Provider": "timeweb",
      "Domains": [
        "my-domain.ru", "sub.my-domain.ru" 
      ],
      "Username": "timeweb-user",
      "Password": "timeweb-password",
      "appkey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  ]
}
Option Required Description
Username Timeweb username
Password Timeweb password
appkey Timeweb API key, should be requested from Timeweb support

Links

  1. Timeweb API documentation (ru) - https://timeweb.com/ru/docs/publichnyj-api-timeweb/metody-api-dlya-virtualnogo-hostinga/#poluchenie-resursnyh-zapisej-domena

Reg.ru

Warning

Reg.ru DNS provider implementation not completed, because provider requires to specify static IPs to access API and does not allow access API from dynamic IP address.

Links

  1. Reg.ru API documentation (ru) - https://www.reg.ru/reseller/api2doc

Rucenter

Warning

Rucenter DNS provider implementation not completed, because provider does not have free plans to access DNS API.

Links

  1. Rucenter API documentation (ru) - https://www.nic.ru/help/api-1390/
  2. Rucenter app registration - https://www.nic.ru/manager/oauth.cgi
  3. Dynamic DNS API - https://www.nic.ru/help/dinamicheskij-dns-dlya-razrabotchikov_4391.html

Notifications

Service notifies about events (successful DNS updates or errors during updates) using Apprise

Example configuration to notify to Telegram bot:

{
  "Apprise": {
    "ServiceUrl": "http://192.168.1.101:8008/notify/",
    "NotifyUrls": [
      "tgram://{bot_token}/{chat_id}/"
    ]
  }
}
Option Description
ServiceUrl URL of deployed Apprise service
NotifyUrls Collection of notification URLs in Apprise format

Apprise support 100+ services to notify, for full list see Apprise Wiki

Healthcheck

Example configuration to send healthcheck pings with Healthchecks.io

{
  "HealthcheckIo": {
    "Url": "https://hc-ping.com/<uuid>"
  } 
}
Option Description
Url Base URL of Healthcheck.io API

Logging

Service use Serilog for logging.

Default logging configuration can be extended in data/settings.json, e.g. to integrate with logging services.

Example configuration to integrate with Seq:

{
  "Serilog": {
    "Using":  [ "Serilog.Sinks.Console", "Serilog.Sinks.Seq" ],
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "outputTemplate": "[{Level:u5}] ({MachineName}/{ThreadId}) {SourceContext} - {Message:lj}{NewLine}{Exception}"
        }
      },
      {
        "Name": "Seq",
        "Args": {
          "serverUrl": "http://192.168.1.100:5341",
          "apiKey": "XXXXXXXXXXXXXXXXX",
          "controlLevelSwitch": "$controlSwitch"
        }
      }
    ]
  }
}

Note

Console sink configuration required to write logs to docker.

Option Description
serverUrl URL of Seq service
apiKey API key generated in Seq for these service
controlLevelSwitch Switch to control logging level. Default level specified in appsettings.json is Information, but it can be controlled from from Seq web UI using these switch.

About

Yet another dynamic DNS updater focused on Russian DNS providers

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages