A simple, dependency-free Python script to keep your DNS records at Mijn.host updated with your dynamic public IP address.
- IPv4 & IPv6 Support: Updates both A and AAAA records.
- Multi-Record: Updates multiple hostnames (e.g.,
@,*) in a single run. - Create Records: Can automatically create records if they don't exist (optional).
- Preview Mode: A
--previewflag shows what would change without executing. - Debug Mode: A
--debugflag for verbose logging.
The script uses a config.json file for configuration.
config.json example:
{
"domain_name": "example.com",
"api_key": "your-mijn-host-api-key",
"record_names": [
"@",
"*"
],
"default_ttl": 300,
"create_records_if_missing": false,
"interval": 1800
}domain_name: Your base domain name.api_key: Your Mijn.host API key.record_names: A list of DNS records to update ("@" for the root domain).default_ttl: The TTL to use when creating new records.create_records_if_missing: (Optional, default: false) Set to true to allow the script to create new DNS records.interval: (Optional, default: 0) The number of seconds to wait between updates. If set to 0, the script will run once and exit.
# Basic usage
python mijn_host_ddns_updater.py --config /path/to/config.json
# Test with a dry run
python mijn_host_ddns_updater.py --config config.json --preview
The container is available at ghcr.io/wimb0/python-mijn-host-dns-updater.
Using docker-compose is the easiest way to manage the container as a service.
- Create a
docker-compose.ymlfile with the content below. - Make sure your
config.jsonis in the same directory. - Run
docker-compose up -dto start the service in the background.
docker-compose.yml file:
services:
mijn-host-ddns-updater:
image: ghcr.io/wimb0/python-mijn-host-dns-updater:latest
restart: unless-stopped
volumes:
- ./config.json:/app/config.json:ro
command: --config config.jsonYou can also use the docker run command directly.
docker run --rm \
--name mijn-host-ddns \
--volume ./config.json:/app/config.json:ro \
ghcr.io/wimb0/python-mijn-host-dns-updater:latest --config config.json
This project was inspired by the original Rust implementation by ldobbelsteen.