mcmodersd/myfritz-resolver

By mcmodersd

Updated 7 days ago

A DynDNS service for MyFritz! domains it auto-updates Cloudflare DNS records on IP changes.

Image
Networking
API management
0

1.1K

mcmodersd/myfritz-resolver repository overview

MyFritz-Resolver

Overview

MyFritz-Resolver is a Dynamic DNS (DDNS) service that keeps your MyFritz! domains in sync with your current IP addresses (both IPv4 and IPv6).

It automatically updates DNS records on Cloudflare whenever your IP changes.

Features

  • Supports both IPv4 (A) and IPv6 (AAAA) records.
  • Automatic DNS updates using the Cloudflare API.
  • Lightweight and easy to deploy using Docker or Docker Compose.
  • Configurable check intervals for IP changes.

Table of Contents

Configuration

Create a config.json file with the following structure:

{
  "zoneId": "your_cloudflare_zone_id",
  "apiToken": "your_cloudflare_api_token",
  "delay": 300,
  "records": [
    {
      "nickname": "Friendly name for reference",
      "id": "cloudflare_record_id",
      "domain": "your_myfritz_domain.myfritz.net"
    },
    {
      "nickname": "Another record (IPv6)",
      "id": "another_cloudflare_record_id",
      "domain": "your_myfritz_domain.myfritz.net"
    }
  ]
}
  • zoneId: Cloudflare Zone ID for your domain.
  • apiToken: Cloudflare API token with DNS edit permissions.
  • delay: Interval (seconds) to check for IP changes (default 300s).
  • records: List of DNS records to manage.
    • nickname: Reference name.
    • id: Cloudflare record ID.
    • domain: MyFritz! domain name.
Permissions

Create a custom Cloudflare API token with the following:

  • Zone: DNS: Edit
  • Zone: Zone: Read
Record IDs

To get all DNS record IDs:

sudo apt update && sudo apt install jq -y

curl -s -X GET "https://api.cloudflare.com/client/v4/zones/YOUR_ZONE_ID/dns_records" \
     -H "Authorization: Bearer YOUR_API_TOKEN" \
     -H "Content-Type: application/json" \
| jq -r '.result[] | select(.type=="A" or .type=="AAAA") | "\(.id)\n\(.type)\n\(.name)\n\(.content)\n"'

Replace YOUR_ZONE_ID and YOUR_API_TOKEN with your actual values.

Example output:
023e105f4ecef8ad9ca31a8372d0c353    # Record ID
A                                   # Record type (IPv4)
example.com                         # Domain
172.253.118.100                     # IPv4 address

023e105f4ecef8ad9ca31a8372d0c354    # Record ID
AAAA                                # Record type (IPv6)
example.com                         # Domain
2404:6800:4003:c11::64              # IPv6 address

Setup

You can run MyFritz-Resolver via Docker, Docker Compose, or directly on your system.

Docker
docker run -d \
  --name MyFritz-Resolver \
  --restart unless-stopped \
  -v ${PWD}/config.json:/app/config.json \
  mcmodersd/myfritz-resolver:latest
Docker Compose

docker-compose.yaml example:

services:
  myfritz-resolver:
    image: mcmodersd/myfritz-resolver:latest
    container_name: MyFritz-Resolver
    restart: unless-stopped
    pull_policy: always
    volumes:
      - ./config.json:/app/config.json

Start the service:

docker-compose up

Tag summary

Content type

Image

Digest

sha256:34e31a0a5

Size

74.8 MB

Last updated

7 days ago

docker pull mcmodersd/myfritz-resolver