A lightweight Python script to dynamically update Namesilo DNS records when your public IP changes. Designed to run via cron.
-
Install uv if not already available.
-
Copy the example config and edit it:
cp config.toml.example config.toml chmod 600 config.toml
-
Set your Namesilo API key, domain, and host in
config.toml. -
Get your API key from the Namesilo API Manager.
| Key | Section | Description | Default |
|---|---|---|---|
api_key |
settings | Your Namesilo API key | (required) |
domain |
settings | Domain to update | (required) |
host |
settings | Subdomain (@ for bare domain, www for www.example.com) |
@ |
ttl |
settings | TTL in seconds (minimum 3600) | 7207 |
ipv4 |
ip | Enable IPv4 (A record) updates | true |
ipv6 |
ip | Enable IPv6 (AAAA record) updates | false |
config_dir |
paths | Directory for state files | (required) |
log_file |
paths | Path to log file | (required) |
# Using default config path (config.toml in current directory)
uv run main.py
# Using custom config path
uv run main.py --config /path/to/config.tomlRun every 15 minutes:
*/15 * * * * /path/to/uv run /path/to/namesilo-dns-updater/main.py --config /path/to/config.tomlcp namesilo-dns-update.service namesilo-dns-update.timer ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now namesilo-dns-update.timer- Fetches your current public IP using multiple fallback services (ipify, icanhazip, ifconfig.co)
- Compares against the last known IP stored in
config_dir - If changed, queries Namesilo API for existing DNS records
- Updates existing record or creates a new one if none exists
- Logs the result to both console and the configured log file
For IPv4: api.ipify.org -> icanhazip.com -> ifconfig.co/ip
For IPv6: api64.ipify.org -> ipv6.icanhazip.com -> ifconfig.co/ip