Lightweight DDNS updater daemon for ApertoDNS (<15MB Alpine)
3.1K
Lightweight Docker image for automatic DDNS updates with ApertoDNS.
amd64, arm64, arm/v7 (Raspberry Pi)# Test run (see if it works)
docker run --rm \
-e TOKEN=your_apertodns_token \
-e DOMAINS=myhost.apertodns.com \
apertodns/updater
# Production run (background with restart)
docker run -d \
--name apertodns-updater \
--restart unless-stopped \
-e TOKEN=your_apertodns_token \
-e DOMAINS=myhost.apertodns.com \
apertodns/updater
version: '3.8'
services:
ddns:
image: apertodns/updater:latest
container_name: apertodns-updater
restart: unless-stopped
environment:
- TOKEN=your_apertodns_token
- DOMAINS=myhost.apertodns.com
- UPDATE_INTERVAL=300
- TZ=Europe/Rome
volumes:
- apertodns_data:/app/data
# Security hardening
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
volumes:
apertodns_data:
| Variable | Required | Default | Description |
|---|---|---|---|
TOKEN | Yes | - | Your ApertoDNS authentication token |
DOMAINS | Yes | - | Comma-separated list of domains to update |
UPDATE_INTERVAL | No | 300 | Seconds between IP checks (minimum: 60) |
DETECT_IPV6 | No | false | Enable IPv6 detection and updates |
LOG_LEVEL | No | info | Log verbosity: info or debug |
TZ | No | UTC | Container timezone (e.g., Europe/Rome) |
apertodns-updaterversion: '3.8'
services:
apertodns:
image: apertodns/updater:latest
container_name: apertodns-updater
restart: unless-stopped
environment:
- TOKEN=your_token_here
- DOMAINS=myhost.apertodns.com
- UPDATE_INTERVAL=300
- TZ=Europe/Rome
volumes:
- apertodns_data:/app/data
read_only: true
security_opt:
- no-new-privileges:true
volumes:
apertodns_data:
Via Docker Tab:
apertodns-updaterapertodns/updater:latestbridgeTOKEN = your_token_hereDOMAINS = myhost.apertodns.comUPDATE_INTERVAL = 300TZ = Europe/Rome/app/data/mnt/user/appdata/apertodns/Via Community Applications:
Search for "ApertoDNS" in Community Applications (if available).
Via Container Manager:
apertodns/updater and downloadapertodns-updaterTOKEN = your_token_hereDOMAINS = myhost.apertodns.comUPDATE_INTERVAL = 300TZ = Europe/Rome/docker/apertodns → Mount: /app/dataVia SSH (docker-compose):
# Create directory
mkdir -p /volume1/docker/apertodns
# Create docker-compose.yml
cat > /volume1/docker/apertodns/docker-compose.yml << 'EOF'
version: '3.8'
services:
apertodns:
image: apertodns/updater:latest
container_name: apertodns-updater
restart: unless-stopped
environment:
- TOKEN=your_token_here
- DOMAINS=myhost.apertodns.com
- UPDATE_INTERVAL=300
- TZ=Europe/Rome
volumes:
- ./data:/app/data
EOF
# Start
cd /volume1/docker/apertodns
docker-compose up -d
Update multiple domains with a single container:
docker run -d \
--name apertodns-updater \
--restart unless-stopped \
-e TOKEN=your_token \
-e DOMAINS=server.apertodns.com,nas.apertodns.com,vpn.apertodns.com \
apertodns/updater
Enable dual-stack (IPv4 + IPv6) updates:
docker run -d \
--name apertodns-updater \
--restart unless-stopped \
-e TOKEN=your_token \
-e DOMAINS=myhost.apertodns.com \
-e DETECT_IPV6=true \
apertodns/updater
Mount a volume to persist the IP cache across container restarts. This prevents unnecessary API calls when the container restarts but the IP hasn't changed:
docker run -d \
--name apertodns-updater \
--restart unless-stopped \
-e TOKEN=your_token \
-e DOMAINS=myhost.apertodns.com \
-v apertodns_data:/app/data \
apertodns/updater
Enable verbose logging for troubleshooting:
docker run -d \
--name apertodns-updater \
-e TOKEN=your_token \
-e DOMAINS=myhost.apertodns.com \
-e LOG_LEVEL=debug \
apertodns/updater
The container includes a built-in health check that verifies:
Check health status:
docker inspect --format='{{.State.Health.Status}}' apertodns-updater
View container logs:
# Follow logs
docker logs -f apertodns-updater
# Last 50 lines
docker logs --tail 50 apertodns-updater
Example output:
[2025-01-15 10:30:00] [INFO] ==========================================
[2025-01-15 10:30:00] [INFO] ApertoDNS Updater v1.0.0
[2025-01-15 10:30:00] [INFO] https://www.apertodns.com
[2025-01-15 10:30:00] [INFO] ==========================================
[2025-01-15 10:30:00] [INFO] Configuration validated successfully
[2025-01-15 10:30:00] [INFO] Configuration:
[2025-01-15 10:30:00] [INFO] - Domains: myhost.apertodns.com
[2025-01-15 10:30:00] [INFO] - Update interval: 300s
[2025-01-15 10:30:00] [INFO] - IPv6 detection: false
[2025-01-15 10:30:01] [INFO] Starting update cycle...
[2025-01-15 10:30:01] [INFO] Initial IPv4 detected: 203.0.113.42
[2025-01-15 10:30:02] [INFO] [myhost.apertodns.com] IP updated successfully: 203.0.113.42
[2025-01-15 10:30:02] [INFO] Update cycle completed
The updater handles standard DynDNS2 response codes:
| Response | Meaning | Action |
|---|---|---|
good <ip> | IP updated successfully | Success |
nochg <ip> | IP unchanged | Success (no update needed) |
badauth | Invalid token | Check TOKEN value |
nohost | Domain not found | Check DOMAINS value |
notfqdn | Invalid hostname format | Check domain format |
abuse | Rate limited | Wait before retrying |
911 | Server error | Automatic retry |
For maximum security, use these options:
services:
apertodns:
image: apertodns/updater:latest
# Read-only filesystem
read_only: true
# Prevent privilege escalation
security_opt:
- no-new-privileges:true
# Drop all capabilities
cap_drop:
- ALL
# Resource limits
deploy:
resources:
limits:
memory: 32M
cpus: '0.1'
You haven't set the TOKEN. Get it from your ApertoDNS dashboard.
You need to specify at least one domain to update.
Your token is invalid or expired. Generate a new one from the dashboard.
The domain doesn't exist in your ApertoDNS account. Create it first at apertodns.com/dashboard.
Too many updates in a short time. The updater uses smart caching to prevent this - make sure you're using a recent version.
Check the logs for errors:
docker logs apertodns-updater
The container needs internet access. Check:
docker exec apertodns-updater curl -s https://api.ipify.orgdocker exec apertodns-updater nslookup api.ipify.orgapiVersion: apps/v1
kind: Deployment
metadata:
name: apertodns-updater
spec:
replicas: 1
selector:
matchLabels:
app: apertodns-updater
template:
metadata:
labels:
app: apertodns-updater
spec:
containers:
- name: updater
image: apertodns/updater:latest
env:
- name: TOKEN
valueFrom:
secretKeyRef:
name: apertodns-secrets
key: token
- name: DOMAINS
value: "myhost.apertodns.com"
- name: UPDATE_INTERVAL
value: "300"
- name: TZ
value: "Europe/Rome"
resources:
limits:
memory: "32Mi"
cpu: "100m"
requests:
memory: "8Mi"
cpu: "10m"
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
runAsNonRoot: true
runAsUser: 1000
volumeMounts:
- name: data
mountPath: /app/data
volumes:
- name: data
emptyDir: {}
| Architecture | Platforms |
|---|---|
linux/amd64 | Intel/AMD 64-bit (most servers, PCs) |
linux/arm64 | ARM 64-bit (Raspberry Pi 4, Apple M1/M2, AWS Graviton) |
linux/arm/v7 | ARM 32-bit (Raspberry Pi 2/3, older ARM devices) |
All architectures are available via the latest tag with automatic platform selection.
# Clone the repository
git clone https://github.com/1r0n3d3v3l0per/apertodns-docker.git
cd apertodns-docker/updater
# Build for current platform
docker build -t apertodns/updater .
# Build multi-arch and push
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm/v7 \
-t apertodns/updater:latest \
--push .
MIT License - see LICENSE for details.
docker pull apertodns/updater:latest