Giter Club home page Giter Club logo

ddns's Introduction

GitHub Workflow Status Latest Tag Version Docker Image Size Docker Image Pulls

Dynamic DNS Monitor

If you have a dynamic IP address and want to host a websites or other services on your home network, you need a way to update your DNS records when your IP address changes. This project provides a service that monitors your dynamic IP address and updates DNS records if a change in IP address is detected. It periodically checks your current IP address and updates DNS records by interacting with your DNS provider's API.

Features

  • Support for multiple DNS providers (currently supported: Route53)
  • Support for multiple subdomains or whildcard of a domain
  • Customizable check interval (default: 60 seconds)
  • Docker support

Requirements

  • Python 3 or Docker
  • API access to your DNS provider

Running with Docker

Docker images are available on Docker Hub

Available architectures: amd64, arm64, armv7

Tag latest is latest stable release.

Tag dev is build from master branch.

Tags vX.Y.Z are stable releases.

Environment variables:

  • PROVIDER: DNS provider (currently supported: route53)

  • PERIOD: Check interval in seconds (default: 60)

  • IPIFY_URL: IPIFY URL (default: https://api.ipify.org) (in case you want to use your own instance of IPIFY)

  • DOMAINS: Comma separated list of domains (e.g. test1.example.com, test2.example.com) or wildcard domains (e.g. *.example.com)

  • DOMAINS_FILE: Filename of a file containing a list of domains (e.g. domains.txt) line by line

You could use both DOMAINS and DOMAINS_FILE at the same time. In case of DOMAINS_FILE is specified mount specified file to /app/ in container. (e.g. /app/domains.txt)

Providers

Route53

Provider Environment variable Description
Route53 AWS_ACCESS_KEY_ID AWS access key ID
Route53 AWS_SECRET_ACCESS_KEY AWS secret access key
Route53 AWS_HOSTED_ZONE_ID AWS hosted zone ID

Minimum required permissions for AWS IAM user:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "VisualEditor0",
      "Effect": "Allow",
      "Action": "route53:ChangeResourceRecordSets",
      "Resource": "arn:aws:route53:::hostedzone/<HOSTED_ZONE_ID>"
    },
    {
      "Sid": "VisualEditor1",
      "Effect": "Allow",
      "Action": "route53:ListHostedZonesByName",
      "Resource": "*"
    },
    {
      "Sid": "VisualEditor2",
      "Effect": "Allow",
      "Action": "route53:ListResourceRecordSets",
      "Resource": "arn:aws:route53:::hostedzone/<HOSTED_ZONE_ID>"
    }
  ]
}

Replace <HOSTED_ZONE_ID> with your hosted zone ID.

Examples

Docker

docker run -d \
  --name ddns \
  -e PROVIDER=route53 \
  -e PERIOD=60 \
  -e AWS_ACCESS_KEY_ID=... \
  -e AWS_SECRET_ACCESS_KEY=... \
  -e AWS_HOSTED_ZONE_ID=... \
  -e DOMAINS=test1.example.com,test2.example.com \
  us2h/ddns

Docker Compose

version: "3.8"

services:
  ddns:
    image: us2h/ddns:latest
    container_name: ddns
    environment:
      - PROVIDER=route53
      - PERIOD=60
      - AWS_ACCESS_KEY_ID=...
      - AWS_SECRET_ACCESS_KEY=...
      - AWS_HOSTED_ZONE_ID=...
      - DOMAINS=test1.example.com,test2.example.com

Docker Compose with domains file

version: "3.8"

services:
  ddns:
    image: us2h/ddns:latest
    container_name: ddns
    environment:
      - PROVIDER=route53
      - PERIOD=60
      - AWS_ACCESS_KEY_ID=...
      - AWS_SECRET_ACCESS_KEY=...
      - AWS_HOSTED_ZONE_ID=...
      - DOMAINS_FILE=domains.txt
    volumes:
      - ./domains.txt:/app/domains.txt

Running with Python

Requirements

  • Python 3
  • pip

Installation of dependencies

pip install -r requirements.txt

Configuration

Set environment variables mentioned above or edit config/common.py file.

Usage

python app.py

ddns's People

Contributors

us2h avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.