This guide explains how to configure Venus OS to automatically update its external IP address on DuckDNS. This ensures remote access remains reliable, even if the IP changes. The guide includes a check for curl
but does not require installation. My first DDNS was from noip. I have to renew that every time, so DuckDNS is a better solution. It keeps working for free. Please support them if you can. I use this DuckDNS domain with WinSCP and Putty.
1. Check if curl
is Installed
First, log in to Venus OS via SSH (e.g., using PuTTY or a terminal) and run:
curl --version
If you see output similar to curl 7.x.x ...
, then curl
is already installed, and you can proceed.
If you get an error, curl
may not be available on your Venus OS version.
2. Create a DuckDNS Account & Subdomain
- Go to https://www.duckdns.org and log in (using GitHub, Google, etc.).
- Create a new subdomain (e.g.,
myvenus.duckdns.org
). - Copy your DuckDNS token, as you’ll need it in the next step.
3. Create the DuckDNS Update Script
On your Venus OS system, create a new script file:
nano /data/duckdns.sh
Add the following content, replacing EXAMPLE with DuckDNS domain (everything before .duckdns.org, so EXAMPLE is EXAMPLE.duckdns.org and replace TOKEN with DuckDNS token:
#!/bin/bash
DUCKDNS_DOMAIN="EXAMPLE"
DUCKDNS_TOKEN="TOKEN"
echo url="https://www.duckdns.org/update?domains=$DUCKDNS_DOMAIN&token=$DUCKDNS_TOKEN&ip=" | curl -k -o /data/duckdns.log -K -
Save and exit Nano:
- Press CTRL + X
- Press Y (Yes)
- Press Enter
Then, make the script executable:
chmod +x /data/duckdns.sh
4. Test the Script
Run the script manually to check if it works:
/data/duckdns.sh
Now, check the log file:
cat /data/duckdns.log
If it says OK
, the update was successful.
5. Automate Updates with Cron
To ensure the script runs automatically every 2 hours (instead of every 5 minutes), edit the cron jobs:
crontab -e
Important Note:
When you run crontab -e
, it opens in the Vim editor by default. If you see ~
characters on the screen, you’re in Vim.
How to insert text and save in Vim:
- Press
i
to enter insert mode. - Paste the line below.
- Press
ESC
, then type:wq
and pressEnter
(to save and exit).
If you don’t see ~
characters, you’re probably using Nano.
How to insert text and save in Nano:
- Paste the line below.
- Press
CTRL + X
, thenY
, thenEnter
.
Please insert this line:
0 */2 * * * /data/duckdns.sh >/dev/null 2>&1
This schedules the script to run every 2 hours (*/2 in the hours field).
To verify that the cron job was added, run:
crontab -l
You should see the scheduled task listed.
6. Verify the IP Update
You can check if Venus OS correctly updates your IP by comparing:
-
Your current external IP address:
curl -s http://checkip.amazonaws.com
-
The IP registered at DuckDNS:
nslookup YOUR_SUBDOMAIN.duckdns.org
If both IPs match, DuckDNS is working correctly!
Conclusion
With this setup, Venus OS will update DuckDNS every 2 hours, ensuring remote access works reliably.
Special thanks to ChatGPT for assisting in writing this guide!