1. Install Dependencies
First, make sure your OpenWrt router has the necessary dependencies installed. Open a terminal and run:
opkg update
opkg install curl
2. Download DDNS-Go
You can download DDNS-Go from GitHub. Use the curl
command to download it directly:
cd /usr/bin
curl -LO https://github.com/oxu925/ddns-go/releases/latest/download/ddns-go-linux-amd64
chmod +x ddns-go-linux-amd64
mv ddns-go-linux-amd64 ddns-go
3. Configure DDNS-Go
Next, create a configuration file. Create the file at /etc/config/ddns-go.conf
:
vi /etc/config/ddns-go.conf
Add the following content to the file:
{
"Domain": "yourdomain.com",
"Token": "your_token",
"Provider": "dns_provider",
"Interval": 300
}
Domain
: The domain you want to update.Token
: The API token for your DDNS service provider.Provider
: The DDNS service provider you are using.Interval
: The update interval (in seconds).
4. Create a Startup Script
To have DDNS-Go run at startup, create a startup script in the /etc/init.d/
directory:
vi /etc/init.d/ddns-go
Add the following content to the script:
#!/bin/sh /etc/rc.common
START=99
STOP=10
start() {
/usr/bin/ddns-go -config /etc/config/ddns-go.conf &
}
stop() {
killall ddns-go
}
Then, make the script executable:
chmod +x /etc/init.d/ddns-go
5. Start DDNS-Go
Use the following commands to start DDNS-Go and enable it to run on boot:
/etc/init.d/ddns-go start
/etc/init.d/ddns-go enable
6. Verify the Setup
Check if DDNS-Go is running:
ps | grep ddns-go
You can also check the log file to ensure there are no errors:
logread | grep ddns-go