| Crates.io | namecheap-ddns |
| lib.rs | namecheap-ddns |
| version | 0.4.0 |
| created_at | 2019-12-14 18:42:51.682896+00 |
| updated_at | 2025-12-20 17:34:45.587861+00 |
| description | Updates the A + Dynamic DNS records for Namecheap |
| homepage | https://github.com/nickjer/namecheap-ddns |
| repository | https://github.com/nickjer/namecheap-ddns |
| max_upload_size | |
| id | 189408 |
| size | 77,556 |
A command line interface (CLI) used to update the A + Dynamic DNS records for Namecheap.
You can download and run the pre-compiled binaries to get up and running immediately.
An alternative is to install using cargo:
cargo install namecheap-ddns
Check the help (--help) for details on using this tool:
Updates the A + Dynamic DNS records for Namecheap
Usage: namecheap-ddns [OPTIONS] --domain <DOMAIN> --subdomain <SUBDOMAIN> --token <TOKEN>
Options:
-d, --domain <DOMAIN> The domain with subdomains [env: NAMECHEAP_DDNS_DOMAIN=]
-s, --subdomain <SUBDOMAIN> The subdomain to update [env: NAMECHEAP_DDNS_SUBDOMAIN=]
-i, --ip <IP> The ip address to set on the subdomains (if blank the ip used to
make this request will be used) [env: NAMECHEAP_DDNS_IP=]
-t, --token <TOKEN> The secret token [env: NAMECHEAP_DDNS_TOKEN=]
--api-url <API_URL> The API URL [env: NAMECHEAP_DDNS_API_URL=]
[default: https://dynamicdns.park-your-domain.com/update]
-h, --help Print help
-V, --version Print version
Set NAMECHEAP_DDNS_TOKEN to the Dynamic DNS Password from Namecheap's Advanced DNS control panel.
Tip: This is not your Namecheap login password.
I want to update the host host1.example.com with my current public facing ip
address:
$ NAMECHEAP_DDNS_TOKEN=... namecheap-ddns -d example.com -s host1
host1.example.com IP address updated to: 123.123.123.123
I want to update multiple subdomains (host1, host2, and host3) with a
given ip address:
$ NAMECHEAP_DDNS_TOKEN=... namecheap-ddns \
> -d example.com \
> -s host1 -s host2 -s host3 \
> -i 123.123.123.123
host1.example.com IP address updated to: 123.123.123.123
host2.example.com IP address updated to: 123.123.123.123
host3.example.com IP address updated to: 123.123.123.123
I want to use an environment variable file:
$ cat .env
export NAMECHEAP_DDNS_TOKEN=...
export NAMECHEAP_DDNS_DOMAIN=example.com
export NAMECHEAP_DDNS_SUBDOMAIN=host1,host2
export NAMECHEAP_DDNS_IP=123.123.123.123
$ source .env
$ namecheap-ddns
host1.example.com IP address updated to: 123.123.123.123
If you want to set this up as a service you will need to create a service file and corresponding timer.
Create the service itself that updates your subdomains:
# /etc/systemd/system/ddns-update.service
[Unit]
Description=Update DDNS records for Namecheap
After=network-online.target
[Service]
Type=simple
Environment=NAMECHEAP_DDNS_TOKEN=<TOKEN>
Environment=NAMECHEAP_DDNS_DOMAIN=<DOMAIN>
Environment=NAMECHEAP_DDNS_SUBDOMAIN=<SUBDOMAIN>
ExecStart=/path/to/namecheap-ddns
User=<USER>
[Install]
WantedBy=default.target
Be sure to fill in the correct path to your binary as well as the environment variables.
Note that the super secret token is in this file, so we should set restrictive permissions:
sudo chmod 600 /etc/systemd/system/ddns-update.service
Create the timer that runs this service:
# /etc/systemd/system/ddns-update.timer
[Unit]
Description=Run DDNS update every 15 minutes
Requires=ddns-update.service
[Timer]
Unit=ddns-update.service
OnUnitInactiveSec=15m
AccuracySec=1s
[Install]
WantedBy=timers.target
Now we reload the daemon with the new services and start them:
sudo systemctl daemon-reload
sudo systemctl enable --now ddns-update.timer
The enable flag ensures the timer starts automatically on boot, and
--now starts it immediately.
You can view the logs from the service with the following command:
sudo journalctl -u ddns-update.service