Run the official ApertoDNS CLI without installing Node.js locally. Perfect for one-off commands, scripting, and automation.
If you prefer to install the CLI directly without Docker:
# Install globally
npm install -g apertodns
# Use directly
apertodns --setup
apertodns --domains
apertodns --force
See the npm package for more details.
amd64 and arm64docker run -it -v apertodns_config:/root/.config/apertodns apertodns/cli --setup
This will prompt you to enter your ApertoDNS credentials and save them to the persistent volume.
docker run -v apertodns_config:/root/.config/apertodns apertodns/cli --domains
docker run -v apertodns_config:/root/.config/apertodns apertodns/cli --force
# Update DNS directly with token (no saved config needed)
docker run --rm apertodns/cli --update --domain myhost.apertodns.com --token YOUR_TOKEN
# Specify custom IP
docker run --rm apertodns/cli --update --domain myhost.apertodns.com --token YOUR_TOKEN --ip 1.2.3.4
If you have an API key, you can skip the setup and use it directly:
# Via command line argument
docker run apertodns/cli --api-key ak_your_api_key_here --domains
# Via environment variable
docker run -e APERTODNS_API_KEY=ak_your_api_key_here apertodns/cli --domains
| Command | Description |
|---|---|
--setup | Interactive configuration wizard |
--domains | List all your domains |
--dashboard | Show dashboard with statistics |
--force | Force update all domains (requires saved config) |
--update | Standalone DynDNS2 update (with --domain and --token) |
--json | Output in JSON format (combine with other commands) |
--help | Show all available options |
Create a docker-compose.yml for easy access:
version: '3.8'
services:
apertodns:
image: apertodns/cli:latest
volumes:
- apertodns_config:/root/.config/apertodns
volumes:
apertodns_config:
Then use:
# Setup
docker compose run --rm apertodns --setup
# List domains
docker compose run --rm apertodns --domains
# Force update
docker compose run --rm apertodns --force
Add this to your .bashrc or .zshrc for convenient access:
alias apertodns='docker run -v apertodns_config:/root/.config/apertodns apertodns/cli'
Then use it like a native command:
apertodns --domains
apertodns --force
apertodns --dashboard
- name: Update DDNS
run: |
docker run \
-e APERTODNS_API_KEY=${{ secrets.APERTODNS_API_KEY }} \
apertodns/cli --force
update_dns:
image: docker:latest
services:
- docker:dind
script:
- docker run -e APERTODNS_API_KEY=$APERTODNS_API_KEY apertodns/cli --force
stage('Update DNS') {
steps {
sh '''
docker run \
-e APERTODNS_API_KEY=${APERTODNS_API_KEY} \
apertodns/cli --force
'''
}
}
docker run -v apertodns_config:/root/.config/apertodns apertodns/cli --domains --json | jq '.domains[].hostname'
docker run -e APERTODNS_API_KEY=ak_xxx apertodns/cli --domains --json | jq '.domains[] | select(.hostname=="myhost.apertodns.com")'
# Add to crontab
*/5 * * * * docker run --rm -v apertodns_config:/root/.config/apertodns apertodns/cli --force >> /var/log/apertodns.log 2>&1
| Variable | Description |
|---|---|
APERTODNS_API_KEY | API key for authentication (bypasses config file) |
The config file is stored at /root/.config/apertodns/config.json inside the container. Mount a named volume or host path to persist credentials:
# Named volume (recommended)
-v apertodns_config:/root/.config/apertodns
# Host path
-v ~/.config/apertodns:/root/.config/apertodns
| Architecture | Tag |
|---|---|
| x86-64 | amd64 |
| ARM64 | arm64 |
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/cli
# Build for current platform
docker build -t apertodns/cli .
# Build multi-arch
docker buildx build --platform linux/amd64,linux/arm64 \
-t apertodns/cli:latest --push .
| Feature | Docker | Native (npm) |
|---|---|---|
| Node.js required | No | Yes |
| Installation | docker pull | npm install -g |
| Updates | docker pull | npm update -g |
| Config location | Volume mount | ~/.config/apertodns |
| Startup time | ~100ms | Instant |
| Best for | CI/CD, containers | Local development |
If you get permission errors with volume mounts:
# Fix permissions
sudo chown -R $(id -u):$(id -g) ~/.config/apertodns
Make sure you're using the same volume name:
# Check volumes
docker volume ls | grep apertodns
# Inspect volume
docker volume inspect apertodns_config
For interactive commands like --setup, use -it flags:
docker run -it -v apertodns_config:/root/.config/apertodns apertodns/cli --setup
MIT License - see LICENSE for details.
Content type
Image
Digest
sha256:d1d477193…
Size
71.2 MB
Last updated
9 months ago
docker pull apertodns/cli